From 4060722b1d94008ca74f9002e32261eefdd47a7d Mon Sep 17 00:00:00 2001 From: bquantump <53361486+bquantump@users.noreply.github.com> Date: Mon, 5 Apr 2021 21:05:00 -0700 Subject: [PATCH] Parent Decoration (#1117) * Mnash 5154 skeleton operations (#1011) * create shell resource operations objects * added trailing newline * Revert "added trailing newline" This reverts commit a24d17db3bcd24f1bd42fde8a6ec9857d16628f9. * update launch settings to add a compute option vs modifying * updates after adding dummy constructor * updates after merge * updates to generated code * address pr comments * update after redoing npm install * update launchsettings * update samples list * revert unintended change * update ordering for launch settings * add resource container shell to mgmt generation (#1025) * add resource container shell to mgmt generation * Address review comments * Renaming Azure.ResourceManager.Compute to Azure.ResourceManager.Sample (#1034) * Update code to support adding and parsing provider name (#1032) * WIP: Update code for provider name * Add operationsGroupMappings example * Only Write out if has field * WIP: update operations config * Update readme * Wip: update compute * WIP: off by one * Remove Synapse * Remove more tests * Remove all mgmt test * Update OutputLibrary.cs * remove imds for now * Update Operations * Tenant id (#1037) * WIP: tenant id * WIP: rebase * Rebase * WIP * WIP: tenant deco * NIT * NIT * WIP: Update * NIT newline * Updates * WIP: updates * Updates * NIT * Enable OperationGroup get associated resource name from one property (#1049) * WIP: update (#1052) * WIP: update * Updates * Fix bad merge * White space * Update config * Mergev3tomgmt (#1062) * Generate public client constructors and options (#1046) Generate public client constructors and options * Make client options class partial (#1055) * Disable buffering for stream responses (#1060) * updates after merge * duplicate end file * regen after merge Co-authored-by: ShivangiReja <45216704+ShivangiReja@users.noreply.github.com> Co-authored-by: Pavel Krymets * merge feature/v3 into feature/mgmt-track2 (#1072) * Generate public client constructors and options (#1046) Generate public client constructors and options * Make client options class partial (#1055) * Disable buffering for stream responses (#1060) * Add Url Encoded Body support (#1042) - Fixes: https://github.com/azure/autorest.csharp/issues/986 * Fix LRO create request from relative path on Unix (#1059) * Remove automated buffering logic (#1064) * Add System.Text.Json converter to models (#1063) Fixes: https://github.com/Azure/autorest.csharp/issues/947 * Fix feature/v3 integration with azure-sdk-for-net (#1065) - Autorest core 3.0.6372 and above crash due to directive ordering bug Tim is digging into now - New shared code does not compile cleanly with azure-sdk-for-net rules * Hide paging classes (#1066) * Add help content (#1067) * Add help content * update after merge Co-authored-by: ShivangiReja <45216704+ShivangiReja@users.noreply.github.com> Co-authored-by: Pavel Krymets Co-authored-by: Chris Hamons Co-authored-by: pavelprystinka <30868871+pavelprystinka@users.noreply.github.com> Co-authored-by: Timothee Guerin * Support generating empty data and data serialization file (#1074) * Add compute to test projects * Support generating empty [Resource]Data.cs and [Resource]Data.Serialization.cs * Upload compute codegen result * Remove codegen result * Resolve merge conflicts * Resolve reference errors * Refactor code * Regenerate Azure.ResourceManager.Sample * Regenerate Azure.Management.Storage * Update all other codegen files when running Generate.ps1 * Re-run Generate.ps1 * Remove the stale compute project * Decorate schema * Change ResourceData to inherit from ObjectType * Regenerate Azure.Management.Storage * Regenerate Azure.ResourceManager.Sample * Correct the Resource name in [Resource]Container.cs and [Resource]Operation.cs * Regenerate Azure.Management.Storage * Regenerate Azure.ResourceManager.Sample * Cleanup comments * Re-run Generate.ps1 * Address review comments * Run Generate.ps1 * regen * add files Co-authored-by: YalinLi0312 * [Mgmt Track 2] 5156 generate empty resource autorest change (#1076) * Empty Resource Code Change * CI fix * Empty Resource Sample Update * Rename arm to mgmt as ARM is ingored * Updating storage sample * Updated resource to be in the Generated folder * Updates after merge * regenerate with feature/v3 changes * WIP: First cust parent algo * Update OutputLibrary.cs * WIP * WIP: * WIP * WIP * WIP * WIP: Updates * WIP * WIP: * WIP * WIP * WIP * WIP * WIP: update configs * WIP: update test * WIP * Update [Resource]Data to inherit the exact matching base class (#1095) * Add Azure.ResourceManager.Core to package reference group * Override inheritance in [Resource]Data * Regenerate Azure.Resourcemanager.Sample * Regenerate Azure.Management.Storage * Update Azure.Core and Azure.ResourceManager.Core version * Rebuild model inheritance * Correct the properties to generate * Update ResourceDataWriter and its serialization writer * Regenerate Azure.ResourceManager.Sample * Update Azure.resourceManager.Core version * Regenerate Azure.Management.Storage * Run Generate.ps1 * Address review comments * Run Generate.ps1 * initial changes to compile * finish merge * initial mgmt fork * Updates test * more changes to mgmt fork * updates after merge * remove unnecessary Arm configuration checks * missed a merge conflict to enable the inheritance code * auto-generate after merge and changes * address review comments * Updates * Update * WIP * Merge * Update * Updates * Updates * Update DataPlaneResponseHeaderGroupWriter.cs * Update DataPlaneLongRunningOperationWriter.cs * Update DataPlaneLongRunningOperationMethod.cs * address review comments * add resource rename test Co-authored-by: m-nash <64171366+m-nash@users.noreply.github.com> Co-authored-by: Allen Zhang Co-authored-by: Yalin Li Co-authored-by: ShivangiReja <45216704+ShivangiReja@users.noreply.github.com> Co-authored-by: Pavel Krymets Co-authored-by: Chris Hamons Co-authored-by: pavelprystinka <30868871+pavelprystinka@users.noreply.github.com> Co-authored-by: Timothee Guerin Co-authored-by: m-nash --- .../Generated/Configuration.json | 2 +- .../Generated/Configuration.json | 2 +- .../Generated/Configuration.json | 2 +- .../Generated/Configuration.json | 2 +- samples/Azure.Management.Storage/readme.md | 5 + .../Generated/Configuration.json | 2 +- .../Generated/Configuration.json | 2 +- .../Azure.ResourceManager.Sample/readme.md | 5 + .../Generated/Configuration.json | 2 +- .../Generated/Configuration.json | 2 +- .../Generated/Configuration.json | 2 +- .../StandaloneGeneratorRunner.cs | 12 +- .../Common/AutoRest/Plugins/Configuration.cs | 7 +- .../Common/Input/CodeModelPartials.cs | 2 + .../Mgmt/Decorator/ExtensionDetection.cs | 35 + .../Mgmt/Decorator/ParentDetection.cs | 106 + .../Decorator/ProviderSegmentDetection.cs | 1 + .../Mgmt/Decorator/TenantDetection.cs | 1 + .../Mgmt/Output/MgmtOutputLibrary.cs | 19 + .../Mgmt/Output/ProviderSegment.cs | 1 + .../Properties/launchSettings.json | 8 + .../Mgmt/MgmtParentTests.cs | 36 + .../Mgmt/OutputLibraryTestBase.cs | 33 + .../Mgmt/ResourceRenameTests.cs | 25 + .../Mgmt/TenantOnlyTests.cs | 27 + .../Generated/Configuration.json | 2 +- .../Generated/Configuration.json | 2 +- .../Generated/Configuration.json | 2 +- .../Generated/Configuration.json | 2 +- .../Inheritance/Generated/Configuration.json | 2 +- .../JsonAsBinary/Generated/Configuration.json | 2 +- .../MgmtParent/Generated/AvailabilitySet.cs | 14 + .../Generated/AvailabilitySetContainer.cs | 18 + .../Generated/AvailabilitySetOperations.cs | 18 + .../AvailabilitySetsRestOperations.cs | 675 +++++ .../MgmtParent/Generated/CodeModel.yaml | 2230 +++++++++++++++++ .../MgmtParent/Generated/Configuration.json | 1 + .../MgmtParent/Generated/DedicatedHost.cs | 14 + .../Generated/DedicatedHostContainer.cs | 18 + .../Generated/DedicatedHostGroup.cs | 14 + .../Generated/DedicatedHostGroupContainer.cs | 18 + .../Generated/DedicatedHostGroupOperations.cs | 18 + .../DedicatedHostGroupsRestOperations.cs | 305 +++ .../Generated/DedicatedHostOperations.cs | 18 + .../Generated/DedicatedHostsRestOperations.cs | 599 +++++ .../AvailabilitySetData.Serialization.cs | 40 + .../Generated/Models/AvailabilitySetData.cs | 28 + ...AvailabilitySetListResult.Serialization.cs | 41 + .../Models/AvailabilitySetListResult.cs | 44 + .../AvailabilitySetUpdate.Serialization.cs | 26 + .../Generated/Models/AvailabilitySetUpdate.cs | 21 + .../Models/DedicatedHostData.Serialization.cs | 40 + .../Generated/Models/DedicatedHostData.cs | 28 + .../DedicatedHostGroupData.Serialization.cs | 40 + .../Models/DedicatedHostGroupData.cs | 28 + .../DedicatedHostListResult.Serialization.cs | 41 + .../Models/DedicatedHostListResult.cs | 44 + .../DedicatedHostUpdate.Serialization.cs | 26 + .../Generated/Models/DedicatedHostUpdate.cs | 21 + ...MachineExtensionImageData.Serialization.cs | 29 + .../VirtualMachineExtensionImageData.cs | 28 + .../Generated/VirtualMachineExtensionImage.cs | 14 + .../VirtualMachineExtensionImageContainer.cs | 18 + .../VirtualMachineExtensionImageOperations.cs | 18 + ...ualMachineExtensionImagesRestOperations.cs | 378 +++ .../TestProjects/MgmtParent/MgmtParent.csproj | 17 + test/TestProjects/MgmtParent/mgmtParent.json | 981 ++++++++ test/TestProjects/MgmtParent/readme.md | 22 + .../Generated/Configuration.json | 2 +- .../ModelShapes/Generated/Configuration.json | 2 +- .../Generated/Configuration.json | 2 +- .../Generated/Configuration.json | 2 +- .../Generated/Configuration.json | 2 +- .../OperationGroupMappings/readme.md | 2 +- .../Generated/Configuration.json | 2 +- .../ResourceRename/Generated/CodeModel.yaml | 471 ++++ .../Generated/Configuration.json | 1 + .../SshPublicKeyInfoData.Serialization.cs | 51 + .../Generated/Models/SshPublicKeyInfoData.cs | 32 + .../Generated/SshPublicKeyInfo.cs | 14 + .../Generated/SshPublicKeyInfoContainer.cs | 18 + .../Generated/SshPublicKeyInfoOperations.cs | 18 + .../Generated/SshPublicKeysRestOperations.cs | 307 +++ .../ResourceRename/ResourceRename.csproj | 17 + test/TestProjects/ResourceRename/readme.md | 18 + .../ResourceRename/resourceRename.json | 207 ++ .../TenantOnly/Generated/Configuration.json | 2 +- test/TestProjects/TenantOnly/readme.md | 4 +- .../Generated/Configuration.json | 2 +- .../Generated/Configuration.json | 2 +- .../Generated/Configuration.json | 2 +- .../Generated/Configuration.json | 2 +- .../body-array/Generated/Configuration.json | 2 +- .../body-boolean/Generated/Configuration.json | 2 +- .../body-byte/Generated/Configuration.json | 2 +- .../body-complex/Generated/Configuration.json | 2 +- .../body-date/Generated/Configuration.json | 2 +- .../Generated/Configuration.json | 2 +- .../Generated/Configuration.json | 2 +- .../Generated/Configuration.json | 2 +- .../Generated/Configuration.json | 2 +- .../body-file/Generated/Configuration.json | 2 +- .../Generated/Configuration.json | 2 +- .../Generated/Configuration.json | 2 +- .../body-integer/Generated/Configuration.json | 2 +- .../body-number/Generated/Configuration.json | 2 +- .../body-string/Generated/Configuration.json | 2 +- .../body-time/Generated/Configuration.json | 2 +- .../constants/Generated/Configuration.json | 2 +- .../Generated/Configuration.json | 2 +- .../Generated/Configuration.json | 2 +- .../Generated/Configuration.json | 2 +- .../Generated/Configuration.json | 2 +- .../head/Generated/Configuration.json | 2 +- .../header/Generated/Configuration.json | 2 +- .../Generated/Configuration.json | 2 +- .../Generated/Configuration.json | 2 +- .../lro/Generated/Configuration.json | 2 +- .../media_types/Generated/Configuration.json | 2 +- .../Generated/Configuration.json | 2 +- .../Generated/Configuration.json | 2 +- .../Generated/Configuration.json | 2 +- .../object-type/Generated/Configuration.json | 2 +- .../paging/Generated/Configuration.json | 2 +- .../Generated/Configuration.json | 2 +- .../Generated/Configuration.json | 2 +- .../Generated/Configuration.json | 2 +- .../url/Generated/Configuration.json | 2 +- .../validation/Generated/Configuration.json | 2 +- .../xml-service/Generated/Configuration.json | 2 +- .../Generated/Configuration.json | 2 +- 131 files changed, 7475 insertions(+), 71 deletions(-) create mode 100644 src/AutoRest.CSharp/Mgmt/Decorator/ExtensionDetection.cs create mode 100644 src/AutoRest.CSharp/Mgmt/Decorator/ParentDetection.cs create mode 100644 test/AutoRest.TestServer.Tests/Mgmt/MgmtParentTests.cs create mode 100644 test/AutoRest.TestServer.Tests/Mgmt/OutputLibraryTestBase.cs create mode 100644 test/AutoRest.TestServer.Tests/Mgmt/ResourceRenameTests.cs create mode 100644 test/AutoRest.TestServer.Tests/Mgmt/TenantOnlyTests.cs create mode 100644 test/TestProjects/MgmtParent/Generated/AvailabilitySet.cs create mode 100644 test/TestProjects/MgmtParent/Generated/AvailabilitySetContainer.cs create mode 100644 test/TestProjects/MgmtParent/Generated/AvailabilitySetOperations.cs create mode 100644 test/TestProjects/MgmtParent/Generated/AvailabilitySetsRestOperations.cs create mode 100644 test/TestProjects/MgmtParent/Generated/CodeModel.yaml create mode 100644 test/TestProjects/MgmtParent/Generated/Configuration.json create mode 100644 test/TestProjects/MgmtParent/Generated/DedicatedHost.cs create mode 100644 test/TestProjects/MgmtParent/Generated/DedicatedHostContainer.cs create mode 100644 test/TestProjects/MgmtParent/Generated/DedicatedHostGroup.cs create mode 100644 test/TestProjects/MgmtParent/Generated/DedicatedHostGroupContainer.cs create mode 100644 test/TestProjects/MgmtParent/Generated/DedicatedHostGroupOperations.cs create mode 100644 test/TestProjects/MgmtParent/Generated/DedicatedHostGroupsRestOperations.cs create mode 100644 test/TestProjects/MgmtParent/Generated/DedicatedHostOperations.cs create mode 100644 test/TestProjects/MgmtParent/Generated/DedicatedHostsRestOperations.cs create mode 100644 test/TestProjects/MgmtParent/Generated/Models/AvailabilitySetData.Serialization.cs create mode 100644 test/TestProjects/MgmtParent/Generated/Models/AvailabilitySetData.cs create mode 100644 test/TestProjects/MgmtParent/Generated/Models/AvailabilitySetListResult.Serialization.cs create mode 100644 test/TestProjects/MgmtParent/Generated/Models/AvailabilitySetListResult.cs create mode 100644 test/TestProjects/MgmtParent/Generated/Models/AvailabilitySetUpdate.Serialization.cs create mode 100644 test/TestProjects/MgmtParent/Generated/Models/AvailabilitySetUpdate.cs create mode 100644 test/TestProjects/MgmtParent/Generated/Models/DedicatedHostData.Serialization.cs create mode 100644 test/TestProjects/MgmtParent/Generated/Models/DedicatedHostData.cs create mode 100644 test/TestProjects/MgmtParent/Generated/Models/DedicatedHostGroupData.Serialization.cs create mode 100644 test/TestProjects/MgmtParent/Generated/Models/DedicatedHostGroupData.cs create mode 100644 test/TestProjects/MgmtParent/Generated/Models/DedicatedHostListResult.Serialization.cs create mode 100644 test/TestProjects/MgmtParent/Generated/Models/DedicatedHostListResult.cs create mode 100644 test/TestProjects/MgmtParent/Generated/Models/DedicatedHostUpdate.Serialization.cs create mode 100644 test/TestProjects/MgmtParent/Generated/Models/DedicatedHostUpdate.cs create mode 100644 test/TestProjects/MgmtParent/Generated/Models/VirtualMachineExtensionImageData.Serialization.cs create mode 100644 test/TestProjects/MgmtParent/Generated/Models/VirtualMachineExtensionImageData.cs create mode 100644 test/TestProjects/MgmtParent/Generated/VirtualMachineExtensionImage.cs create mode 100644 test/TestProjects/MgmtParent/Generated/VirtualMachineExtensionImageContainer.cs create mode 100644 test/TestProjects/MgmtParent/Generated/VirtualMachineExtensionImageOperations.cs create mode 100644 test/TestProjects/MgmtParent/Generated/VirtualMachineExtensionImagesRestOperations.cs create mode 100644 test/TestProjects/MgmtParent/MgmtParent.csproj create mode 100644 test/TestProjects/MgmtParent/mgmtParent.json create mode 100644 test/TestProjects/MgmtParent/readme.md create mode 100644 test/TestProjects/ResourceRename/Generated/CodeModel.yaml create mode 100644 test/TestProjects/ResourceRename/Generated/Configuration.json create mode 100644 test/TestProjects/ResourceRename/Generated/Models/SshPublicKeyInfoData.Serialization.cs create mode 100644 test/TestProjects/ResourceRename/Generated/Models/SshPublicKeyInfoData.cs create mode 100644 test/TestProjects/ResourceRename/Generated/SshPublicKeyInfo.cs create mode 100644 test/TestProjects/ResourceRename/Generated/SshPublicKeyInfoContainer.cs create mode 100644 test/TestProjects/ResourceRename/Generated/SshPublicKeyInfoOperations.cs create mode 100644 test/TestProjects/ResourceRename/Generated/SshPublicKeysRestOperations.cs create mode 100644 test/TestProjects/ResourceRename/ResourceRename.csproj create mode 100644 test/TestProjects/ResourceRename/readme.md create mode 100644 test/TestProjects/ResourceRename/resourceRename.json diff --git a/samples/AppConfiguration/Generated/Configuration.json b/samples/AppConfiguration/Generated/Configuration.json index 396f7a8e923..3ebedf480af 100644 --- a/samples/AppConfiguration/Generated/Configuration.json +++ b/samples/AppConfiguration/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"AppConfiguration","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"AppConfiguration","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/samples/Azure.AI.DocumentTranslation/Generated/Configuration.json b/samples/Azure.AI.DocumentTranslation/Generated/Configuration.json index de3053ea016..9ee243e48d7 100644 --- a/samples/Azure.AI.DocumentTranslation/Generated/Configuration.json +++ b/samples/Azure.AI.DocumentTranslation/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"Azure.AI.DocumentTranslation","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":true,"CredentialTypes":["AzureKeyCredential"],"CredentialScopes":[],"CredentialHeaderName":"Ocp-Apim-Subscription-Key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"Azure.AI.DocumentTranslation","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":true,"CredentialTypes":["AzureKeyCredential"],"CredentialScopes":[],"CredentialHeaderName":"Ocp-Apim-Subscription-Key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/samples/Azure.AI.FormRecognizer/Generated/Configuration.json b/samples/Azure.AI.FormRecognizer/Generated/Configuration.json index 881671ec5d8..a96acc2548f 100644 --- a/samples/Azure.AI.FormRecognizer/Generated/Configuration.json +++ b/samples/Azure.AI.FormRecognizer/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"Azure.AI.FormRecognizer","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":false,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"Azure.AI.FormRecognizer","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":false,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/samples/Azure.Management.Storage/Generated/Configuration.json b/samples/Azure.Management.Storage/Generated/Configuration.json index fedde638ca8..2c16cb68fe2 100644 --- a/samples/Azure.Management.Storage/Generated/Configuration.json +++ b/samples/Azure.Management.Storage/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"Azure.Management.Storage","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":true,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":true,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{"Operations":"Microsoft.Storage/operations","Skus":"Microsoft.Storage/skus","Usages":"Microsoft.Storage/locations/usages","PrivateLinkResources":"Microsoft.Storage/storageAccounts/privateLinkResources"},"OperationGroupToResource":{"Operations":"Operation","Skus":"Sku","Usages":"Usage","PrivateLinkResources":"PrivateLinkResource","StorageAccounts":"StorageAccount"},"ResourceRename":{"BlobServiceProperties":"BlobService","FileServiceProperties":"FileService"}} \ No newline at end of file +{"OutputFolder":".","Namespace":"Azure.Management.Storage","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":true,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":true,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{"Operations":"Microsoft.Storage/operations","Skus":"Microsoft.Storage/skus","Usages":"Microsoft.Storage/locations/usages","PrivateLinkResources":"Microsoft.Storage/storageAccounts/privateLinkResources"},"OperationGroupToResource":{"Operations":"Operation","Skus":"Sku","Usages":"Usage","PrivateLinkResources":"PrivateLinkResource","StorageAccounts":"StorageAccount"},"ResourceRename":{"BlobServiceProperties":"BlobService","FileServiceProperties":"FileService"},"OperationGroupToParent":{"BlobContainers":"Microsoft.Storage/storageAccounts","FileShares":"Microsoft.Storage/storageAccounts","Usages":"subscriptions","StorageAccounts":"any"}} \ No newline at end of file diff --git a/samples/Azure.Management.Storage/readme.md b/samples/Azure.Management.Storage/readme.md index eb19025cbed..cb52161c7a2 100644 --- a/samples/Azure.Management.Storage/readme.md +++ b/samples/Azure.Management.Storage/readme.md @@ -30,5 +30,10 @@ operation-group-to-resource: resource-rename: BlobServiceProperties: BlobService FileServiceProperties: FileService +operation-group-to-parent: + BlobContainers: Microsoft.Storage/storageAccounts + FileShares: Microsoft.Storage/storageAccounts + Usages: subscriptions + StorageAccounts: any ``` diff --git a/samples/Azure.Network.Management.Interface/Generated/Configuration.json b/samples/Azure.Network.Management.Interface/Generated/Configuration.json index 4b84614afe8..94423f72a8b 100644 --- a/samples/Azure.Network.Management.Interface/Generated/Configuration.json +++ b/samples/Azure.Network.Management.Interface/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"Azure.Network.Management.Interface","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"Azure.Network.Management.Interface","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/samples/Azure.ResourceManager.Sample/Generated/Configuration.json b/samples/Azure.ResourceManager.Sample/Generated/Configuration.json index 7a2c6c837e9..bb0c06c47f1 100644 --- a/samples/Azure.ResourceManager.Sample/Generated/Configuration.json +++ b/samples/Azure.ResourceManager.Sample/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"Azure.ResourceManager.Sample","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":true,"PublicClients":true,"ModelNamespace":false,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{"Operations":"Microsoft.Compute/operations","VirtualMachineExtensionImages":"Microsoft.Compute/locations/publishers/vmextension","VirtualMachineImages":"Microsoft.Compute/locations/publishers/vmimage","Usage":"Microsoft.Compute/locations/usages","VirtualMachineSizes":"Microsoft.Compute/locations/vmSizes","VirtualMachineScaleSetRollingUpgrades":"Microsoft.Compute/virtualMachineScaleSets/rollingUpgrades","LogAnalytics":"Microsoft.Compute/locations/logAnalytics"},"OperationGroupToResource":{"Operations":"Operation","VirtualMachineExtensionImages":"VirtualMachineExtensionImage","VirtualMachineImages":"VirtualMachineImage","Usage":"Usage","VirtualMachineSizes":"VirtualMachineSize","VirtualMachineScaleSetRollingUpgrades":"VirtualMachineScaleSetRollingUpgrade","LogAnalytics":"LogAnalyticsOperationResult"},"ResourceRename":{"SshPublicKey":"SshPublicKeyInfo","LogAnalyticsOperationResult":"LogAnalytics","SshPublicKeyResource":"SshPublicKey"}} \ No newline at end of file +{"OutputFolder":".","Namespace":"Azure.ResourceManager.Sample","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":true,"PublicClients":true,"ModelNamespace":false,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{"Operations":"Microsoft.Compute/operations","VirtualMachineExtensionImages":"Microsoft.Compute/locations/publishers/vmextension","VirtualMachineImages":"Microsoft.Compute/locations/publishers/vmimage","Usage":"Microsoft.Compute/locations/usages","VirtualMachineSizes":"Microsoft.Compute/locations/vmSizes","VirtualMachineScaleSetRollingUpgrades":"Microsoft.Compute/virtualMachineScaleSets/rollingUpgrades","LogAnalytics":"Microsoft.Compute/locations/logAnalytics"},"OperationGroupToResource":{"Operations":"Operation","VirtualMachineExtensionImages":"VirtualMachineExtensionImage","VirtualMachineImages":"VirtualMachineImage","Usage":"Usage","VirtualMachineSizes":"VirtualMachineSize","VirtualMachineScaleSetRollingUpgrades":"VirtualMachineScaleSetRollingUpgrade","LogAnalytics":"LogAnalyticsOperationResult"},"ResourceRename":{"SshPublicKey":"SshPublicKeyInfo","LogAnalyticsOperationResult":"LogAnalytics","SshPublicKeyResource":"SshPublicKey"},"OperationGroupToParent":{"LogAnalytics":"subscriptions","VirtualMachineExtensionImages":"Microsoft.Compute/locations/publishers","VirtualMachineImages":"Microsoft.Compute/locations","VirtualMachineScaleSetVMExtensions":"Microsoft.Compute/virtualMachineScaleSets"}} \ No newline at end of file diff --git a/samples/Azure.ResourceManager.Sample/readme.md b/samples/Azure.ResourceManager.Sample/readme.md index 07a552aacc7..ad250799dc3 100644 --- a/samples/Azure.ResourceManager.Sample/readme.md +++ b/samples/Azure.ResourceManager.Sample/readme.md @@ -31,6 +31,11 @@ resource-rename: SshPublicKey : SshPublicKeyInfo LogAnalyticsOperationResult: LogAnalytics SshPublicKeyResource: SshPublicKey +operation-group-to-parent: + LogAnalytics: subscriptions + VirtualMachineExtensionImages: Microsoft.Compute/locations/publishers + VirtualMachineImages: Microsoft.Compute/locations + VirtualMachineScaleSetVMExtensions: Microsoft.Compute/virtualMachineScaleSets modelerfour: lenient-model-deduplication: true ``` diff --git a/samples/Azure.Storage.Tables/Generated/Configuration.json b/samples/Azure.Storage.Tables/Generated/Configuration.json index 2cbea776ecb..3b6b6ea7ba6 100644 --- a/samples/Azure.Storage.Tables/Generated/Configuration.json +++ b/samples/Azure.Storage.Tables/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"Azure.Storage.Tables","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"Azure.Storage.Tables","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/samples/CognitiveSearch/Generated/Configuration.json b/samples/CognitiveSearch/Generated/Configuration.json index 6d8ef6e0a89..4d6370f7ed7 100644 --- a/samples/CognitiveSearch/Generated/Configuration.json +++ b/samples/CognitiveSearch/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"CognitiveSearch","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"CognitiveSearch","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/samples/CognitiveServices.TextAnalytics/Generated/Configuration.json b/samples/CognitiveServices.TextAnalytics/Generated/Configuration.json index 543e7a3688f..302f8505f81 100644 --- a/samples/CognitiveServices.TextAnalytics/Generated/Configuration.json +++ b/samples/CognitiveServices.TextAnalytics/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"CognitiveServices.TextAnalytics","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"CognitiveServices.TextAnalytics","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/src/AutoRest.CSharp/Common/AutoRest/Communication/StandaloneGeneratorRunner.cs b/src/AutoRest.CSharp/Common/AutoRest/Communication/StandaloneGeneratorRunner.cs index cf2ba3c81ee..d7b5dc78a4a 100644 --- a/src/AutoRest.CSharp/Common/AutoRest/Communication/StandaloneGeneratorRunner.cs +++ b/src/AutoRest.CSharp/Common/AutoRest/Communication/StandaloneGeneratorRunner.cs @@ -95,6 +95,13 @@ internal static string SaveConfiguration(Configuration configuration) } writer.WriteEndObject(); + writer.WriteStartObject(nameof(Configuration.OperationGroupToParent)); + foreach (var keyval in configuration.OperationGroupToParent) + { + writer.WriteString(keyval.Key, keyval.Value); + } + writer.WriteEndObject(); + writer.WriteEndObject(); } @@ -107,7 +114,7 @@ private static string NormalizePath(Configuration configuration, string sharedSo return Path.GetRelativePath(configuration.OutputFolder, sharedSourceFolder); } - private static Configuration LoadConfiguration(string basePath, string json) + internal static Configuration LoadConfiguration(string basePath, string json) { JsonDocument document = JsonDocument.Parse(json); var root = document.RootElement; @@ -147,7 +154,8 @@ private static Configuration LoadConfiguration(string basePath, string json) root.GetProperty(nameof(Configuration.LowLevelClient)).GetBoolean(), root.GetProperty(nameof(Configuration.OperationGroupToResourceType)), root.GetProperty(nameof(Configuration.OperationGroupToResource)), - root.GetProperty(nameof(Configuration.ResourceRename)) + root.GetProperty(nameof(Configuration.ResourceRename)), + root.GetProperty(nameof(Configuration.OperationGroupToParent)) ); } } diff --git a/src/AutoRest.CSharp/Common/AutoRest/Plugins/Configuration.cs b/src/AutoRest.CSharp/Common/AutoRest/Plugins/Configuration.cs index ed78f6c9906..f15dbf754ca 100644 --- a/src/AutoRest.CSharp/Common/AutoRest/Plugins/Configuration.cs +++ b/src/AutoRest.CSharp/Common/AutoRest/Plugins/Configuration.cs @@ -12,7 +12,7 @@ namespace AutoRest.CSharp.AutoRest.Plugins { internal class Configuration { - public Configuration(string outputFolder, string? ns, string? name, string[] sharedSourceFolders, bool saveInputs, bool azureArm, bool publicClients, bool modelNamespace, bool headAsBoolean, bool skipCSProjPackageReference, string[] credentialTypes, string[] credentialScopes, string credentialHeaderName, bool lowLevelClient, JsonElement? operationGroupToResourceType = default, JsonElement? operationGroupToResource = default, JsonElement? resourceRename = default) + public Configuration(string outputFolder, string? ns, string? name, string[] sharedSourceFolders, bool saveInputs, bool azureArm, bool publicClients, bool modelNamespace, bool headAsBoolean, bool skipCSProjPackageReference, string[] credentialTypes, string[] credentialScopes, string credentialHeaderName, bool lowLevelClient, JsonElement? operationGroupToResourceType = default, JsonElement? operationGroupToResource = default, JsonElement? resourceRename = default, JsonElement? operationGroupToParent = default) { OutputFolder = outputFolder; Namespace = ns; @@ -31,6 +31,7 @@ public Configuration(string outputFolder, string? ns, string? name, string[] sha OperationGroupToResourceType = operationGroupToResourceType?.ValueKind == JsonValueKind.Null ? new Dictionary() : JsonSerializer.Deserialize>(operationGroupToResourceType.ToString()); OperationGroupToResource = operationGroupToResource?.ValueKind == JsonValueKind.Null ? new Dictionary() : JsonSerializer.Deserialize>(operationGroupToResource.ToString()); ResourceRename = resourceRename?.ValueKind == JsonValueKind.Null ? new Dictionary() : JsonSerializer.Deserialize>(resourceRename.ToString()); + OperationGroupToParent = operationGroupToParent?.ValueKind == JsonValueKind.Null ? new Dictionary() : JsonSerializer.Deserialize>(operationGroupToParent.ToString()); } public string OutputFolder { get; } @@ -52,6 +53,7 @@ public Configuration(string outputFolder, string? ns, string? name, string[] sha public IReadOnlyDictionary OperationGroupToResource { get; } public IReadOnlyDictionary ResourceRename { get; } public bool LowLevelClient { get; } + public IReadOnlyDictionary OperationGroupToParent { get; } public static Configuration GetConfiguration(IPluginCommunication autoRest) { @@ -72,7 +74,8 @@ public static Configuration GetConfiguration(IPluginCommunication autoRest) autoRest.GetValue("low-level-client").GetAwaiter().GetResult() ?? false, autoRest.GetValue("operation-group-to-resource-type").GetAwaiter().GetResult(), autoRest.GetValue("operation-group-to-resource").GetAwaiter().GetResult(), - autoRest.GetValue("resource-rename").GetAwaiter().GetResult() + autoRest.GetValue("resource-rename").GetAwaiter().GetResult(), + autoRest.GetValue("operation-group-to-parent").GetAwaiter().GetResult() ); } diff --git a/src/AutoRest.CSharp/Common/Input/CodeModelPartials.cs b/src/AutoRest.CSharp/Common/Input/CodeModelPartials.cs index 4475d800432..9c3c5814726 100644 --- a/src/AutoRest.CSharp/Common/Input/CodeModelPartials.cs +++ b/src/AutoRest.CSharp/Common/Input/CodeModelPartials.cs @@ -96,6 +96,8 @@ internal partial class OperationGroup public string ResourceType { get; set; } public string Resource { get; set; } public bool IsTenantResource { get; set; } + public bool IsExtensionResource { get; set; } + public string Parent { get; set; } public Dictionary> OperationHttpMethodMapping { get; set; } } diff --git a/src/AutoRest.CSharp/Mgmt/Decorator/ExtensionDetection.cs b/src/AutoRest.CSharp/Mgmt/Decorator/ExtensionDetection.cs new file mode 100644 index 00000000000..435f26a4396 --- /dev/null +++ b/src/AutoRest.CSharp/Mgmt/Decorator/ExtensionDetection.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License +using System; +using System.Collections.Generic; +using AutoRest.CSharp.Output.Models.Requests; +using AutoRest.CSharp.Input; + +namespace AutoRest.CSharp.Output.Models.Type.Decorate +{ + internal static class ExtensionDetection + { + public static bool IsExtension(OperationGroup operationGroup) + { + foreach (var keyValue in operationGroup.OperationHttpMethodMapping) + { + foreach (var httpRequest in keyValue.Value) + { + bool providerBefore = false; + var providerSegmentsList = ((HttpRequest?)httpRequest?.Protocol?.Http)?.ProviderSegments; + for (int i = 0; i < providerSegmentsList?.Count; i++) + { + var segment = providerSegmentsList[i]; + var areEqual = segment.TokenValue.Equals(operationGroup.ResourceType); + if (areEqual && segment.IsFullProvider && (segment.HadSpecialReference || providerBefore)) + { + return true; + } + providerBefore = providerBefore || (segment.HasReferenceSuccessor && !areEqual); + } + } + } + return false; + } + } +} diff --git a/src/AutoRest.CSharp/Mgmt/Decorator/ParentDetection.cs b/src/AutoRest.CSharp/Mgmt/Decorator/ParentDetection.cs new file mode 100644 index 00000000000..4bb91d76e13 --- /dev/null +++ b/src/AutoRest.CSharp/Mgmt/Decorator/ParentDetection.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License +using System; +using System.Collections.Generic; +using AutoRest.CSharp.Output.Models.Requests; +using AutoRest.CSharp.Input; +using System.Linq; + +namespace AutoRest.CSharp.Output.Models.Type.Decorate +{ + internal static class ParentDetection + { + public static string GetParent(OperationGroup operationGroup) + { + if (operationGroup.IsTenantResource) + { + return TenantDetection.TenantName; + } + if (operationGroup.IsExtensionResource) + { + throw new ArgumentException($"Could not set parent for operations group {operationGroup.Key}. This an extensions resource, please add to readme.md"); + } + var method = GetBestMethod(operationGroup.OperationHttpMethodMapping); + if (method == null) + { + throw new ArgumentException($"Could not set parent for operations group {operationGroup.Key}. Please add to readme.md"); + } + + var fullProvider = GetFullProvider(method.ProviderSegments); + if (fullProvider == null) + { + throw new ArgumentException($"Could not set parent for operations group {operationGroup.Key}. Please add to readme.md"); + } + var canidateParent = ParseMethodForParent(fullProvider, method.Path, operationGroup.ResourceType); + if (canidateParent == string.Empty) + { + throw new ArgumentException($"Could not set parent for operations group {operationGroup.Key}. Please add to readme.md"); + } + return canidateParent; + } + + public static HttpRequest? GetBestMethod(Dictionary> operations) + { + List? requests; + + if (operations.TryGetValue(HttpMethod.Put, out requests)) + { + return (HttpRequest?)requests[0].Protocol?.Http; + } + if (operations.TryGetValue(HttpMethod.Delete, out requests)) + { + return (HttpRequest?)requests[0].Protocol?.Http; + } + if (operations.TryGetValue(HttpMethod.Patch, out requests)) + { + return (HttpRequest?)requests[0].Protocol?.Http; + } + if (operations.TryGetValue(HttpMethod.Get, out requests)) // optimized which get to return here + { + return (HttpRequest?)requests[0].Protocol?.Http; + } + return null; + } + + private static ProviderSegment? GetFullProvider(List providerSegments) + { + return providerSegments.Last().IsFullProvider ? providerSegments.Last() : null; + } + + private static string ParseMethodForParent(ProviderSegment fullProvider, string path, string resourceType) + { + //case 1: + // Microsoft.Network/virtualNetworks/ == lastFullProvider + // resourceType = Microsoft.Network/virtualNetworks + // + if (fullProvider.TokenValue.Trim('/').Equals(resourceType)) + { + var lastSlash = path.LastIndexOf('/', fullProvider.IndexFoundAt - 1); //ok because tenant only resources should never get here. + var lastClosedBrace = path.LastIndexOf('}', lastSlash); + if (path[lastSlash + 1] != '{') + { + return string.Empty; + } + return lastClosedBrace > -1 ? path.Substring(lastClosedBrace + 1, lastSlash - lastClosedBrace).Trim('/') : path.Substring(lastClosedBrace + 1, lastSlash).Trim('/'); + + } + //case 2: + // Microsoft.Network/virtualNetworks/ == lastFullProvider + // resourceType = Microsoft.Network/virtualNetwork/subnets + // expected path to be: Microsoft.Network/virtualNetworks/{}/constant/{}/constant/.... (verfied in construction of type provider) + // + return resourceType.StartsWith(fullProvider.TokenValue) ? resourceType.Substring(0, resourceType.LastIndexOf('/')) : string.Empty; + } + + public static void VerfiyParents(System.Collections.Generic.ICollection operationGroups, HashSet ResourceTypes) + { + foreach (var operationsGroup in operationGroups) + { + if (operationsGroup.Parent != null && !ResourceTypes.Contains(operationsGroup.Parent)) + { + throw new ArgumentException($"Could not set parent for operations group {operationsGroup.Key} with parent {operationsGroup.Parent}. key Please add to readme.md"); + } + } + } + } +} diff --git a/src/AutoRest.CSharp/Mgmt/Decorator/ProviderSegmentDetection.cs b/src/AutoRest.CSharp/Mgmt/Decorator/ProviderSegmentDetection.cs index cea2742d3d7..aa42dc5eb3b 100644 --- a/src/AutoRest.CSharp/Mgmt/Decorator/ProviderSegmentDetection.cs +++ b/src/AutoRest.CSharp/Mgmt/Decorator/ProviderSegmentDetection.cs @@ -25,6 +25,7 @@ public static List GetProviderSegments(string path) currentToken.NoPredecessor = offset == 0; do { + currentToken.IndexFoundAt = offset; offset += ProviderSegment.Providers.Length; nextReference = path.IndexOf('{', offset); currentToken.HasReferenceSuccessor = nextReference > -1; diff --git a/src/AutoRest.CSharp/Mgmt/Decorator/TenantDetection.cs b/src/AutoRest.CSharp/Mgmt/Decorator/TenantDetection.cs index 55f318c2f43..e89cf80f2ba 100644 --- a/src/AutoRest.CSharp/Mgmt/Decorator/TenantDetection.cs +++ b/src/AutoRest.CSharp/Mgmt/Decorator/TenantDetection.cs @@ -9,6 +9,7 @@ namespace AutoRest.CSharp.Output.Models.Type.Decorate { internal static class TenantDetection { + internal static readonly string TenantName = "tenant"; public static bool IsTenantOnly(OperationGroup operationGroup) { bool foundTenant = false; diff --git a/src/AutoRest.CSharp/Mgmt/Output/MgmtOutputLibrary.cs b/src/AutoRest.CSharp/Mgmt/Output/MgmtOutputLibrary.cs index 50b6912641d..a8761cbd09f 100644 --- a/src/AutoRest.CSharp/Mgmt/Output/MgmtOutputLibrary.cs +++ b/src/AutoRest.CSharp/Mgmt/Output/MgmtOutputLibrary.cs @@ -48,6 +48,13 @@ public MgmtOutputLibrary(CodeModel codeModel, BuildContext co public IEnumerable ResourceContainers => EnsureResourceContainers().Values; + private static HashSet ResourceTypes = new HashSet + { + "resourceGroups", + "subscriptions", + "tenant" + }; + private Dictionary? _models; public Dictionary ResourceSchemaMap => _resourceModels ??= BuildResourceModels(); @@ -238,6 +245,17 @@ private void DecorateOperationGroup() operationsGroup.ResourceType = _context.Configuration.OperationGroupToResourceType.TryGetValue(operationsGroup.Key, out resourceType) ? resourceType : ResourceTypeBuilder.ConstructOperationResourceType(operationsGroup); operationsGroup.IsTenantResource = TenantDetection.IsTenantOnly(operationsGroup); string? resource; + ResourceTypes.Add(operationsGroup.ResourceType); + operationsGroup.IsExtensionResource = ExtensionDetection.IsExtension(operationsGroup); + + // TODO better support for extension resources + string? parent; + if (_context.Configuration.OperationGroupToParent.TryGetValue(operationsGroup.Key, out parent)) + { + // If overriden, add parent to known types list (trusting user input) + ResourceTypes.Add(parent); + } + operationsGroup.Parent = parent ?? ParentDetection.GetParent(operationsGroup); operationsGroup.Resource = _context.Configuration.OperationGroupToResource.TryGetValue(operationsGroup.Key, out resource) ? resource : SchemaDetection.GetSchema(operationsGroup).Name; AddOperationGroupToResourceMap(operationsGroup); string? nameOverride; @@ -246,6 +264,7 @@ private void DecorateOperationGroup() operationsGroup.Resource = nameOverride; } } + ParentDetection.VerfiyParents(_codeModel.OperationGroups, ResourceTypes); } private void DecorateSchema() diff --git a/src/AutoRest.CSharp/Mgmt/Output/ProviderSegment.cs b/src/AutoRest.CSharp/Mgmt/Output/ProviderSegment.cs index 436cddb8cd3..c62f0c20bb7 100644 --- a/src/AutoRest.CSharp/Mgmt/Output/ProviderSegment.cs +++ b/src/AutoRest.CSharp/Mgmt/Output/ProviderSegment.cs @@ -12,6 +12,7 @@ internal class ProviderSegment internal string TokenValue { get; set; } internal bool HadSpecialReference { get; set; } internal bool IsLastProvider { get; set; } + internal int IndexFoundAt { get; set; } internal ProviderSegment() { TokenValue = string.Empty; diff --git a/src/AutoRest.CSharp/Properties/launchSettings.json b/src/AutoRest.CSharp/Properties/launchSettings.json index ba7d4beedd4..5e335efb397 100644 --- a/src/AutoRest.CSharp/Properties/launchSettings.json +++ b/src/AutoRest.CSharp/Properties/launchSettings.json @@ -180,6 +180,10 @@ "commandName": "Project", "commandLineArgs": "--standalone $(SolutionDir)\\test\\TestServerProjects\\media_types\\Generated" }, + "MgmtParent": { + "commandName": "Project", + "commandLineArgs": "--standalone $(SolutionDir)\\test\\TestProjects\\MgmtParent\\Generated" + }, "model-flattening": { "commandName": "Project", "commandLineArgs": "--standalone $(SolutionDir)\\test\\TestServerProjects\\model-flattening\\Generated" @@ -228,6 +232,10 @@ "commandName": "Project", "commandLineArgs": "--standalone $(SolutionDir)\\test\\TestServerProjects\\required-optional\\Generated" }, + "ResourceRename": { + "commandName": "Project", + "commandLineArgs": "--standalone $(SolutionDir)\\test\\TestProjects\\ResourceRename\\Generated" + }, "subscriptionId-apiVersion": { "commandName": "Project", "commandLineArgs": "--standalone $(SolutionDir)\\test\\TestServerProjects\\subscriptionId-apiVersion\\Generated" diff --git a/test/AutoRest.TestServer.Tests/Mgmt/MgmtParentTests.cs b/test/AutoRest.TestServer.Tests/Mgmt/MgmtParentTests.cs new file mode 100644 index 00000000000..6e660a63cf6 --- /dev/null +++ b/test/AutoRest.TestServer.Tests/Mgmt/MgmtParentTests.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.IO; +using System.Threading.Tasks; +using NUnit.Framework; +using AutoRest.CSharp.AutoRest.Communication; +using AutoRest.CSharp.Input; +using AutoRest.CSharp.AutoRest.Plugins; +using AutoRest.CSharp.Input.Source; +using AutoRest.CSharp.Output.Models.Types; +using System.Reflection; +using System.Text; +using System.Text.Json; + +namespace AutoRest.TestServer.Tests.Mgmt +{ + internal class MgmtParentTests : OutputLibraryTestBase + { + [Test] + public void TestParentComputer() + { + CodeModel model = Generate("MgmtParent").Result; + foreach (var operations in model.OperationGroups) + { + Assert.IsNotNull(operations.Parent); + if (operations.Key.Equals("VirtualMachineExtensionImages")) + Assert.IsTrue(operations.Parent.Equals("Microsoft.Compute/locations/publishers")); + else if (operations.Key.Equals("AvailabilitySets")) + Assert.IsTrue(operations.Parent.Equals("resourceGroups")); + else if (operations.Key.Equals("DedicatedHosts")) + Assert.IsTrue(operations.Parent.Equals("Microsoft.Compute/hostGroups")); + } + } + } +} diff --git a/test/AutoRest.TestServer.Tests/Mgmt/OutputLibraryTestBase.cs b/test/AutoRest.TestServer.Tests/Mgmt/OutputLibraryTestBase.cs new file mode 100644 index 00000000000..535824c24bf --- /dev/null +++ b/test/AutoRest.TestServer.Tests/Mgmt/OutputLibraryTestBase.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.IO; +using System.Reflection; +using System.Threading.Tasks; +using AutoRest.CSharp.AutoRest.Communication; +using AutoRest.CSharp.AutoRest.Plugins; +using AutoRest.CSharp.Input; +using AutoRest.CSharp.Input.Source; +using AutoRest.CSharp.Output.Models.Types; +using NUnit.Framework; + +namespace AutoRest.TestServer.Tests.Mgmt +{ + internal abstract class OutputLibraryTestBase + { + protected static async Task Generate(string testProject) + { + var basePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + basePath = Path.Combine(basePath.Substring(0, basePath.IndexOf("autorest.csharp")), "autorest.csharp", "test", "TestProjects", testProject, "Generated"); + var configuration = StandaloneGeneratorRunner.LoadConfiguration(basePath, File.ReadAllText(Path.Combine(basePath, "Configuration.json"))); + var codeModelTask = Task.Run(() => CodeModelSerialization.DeserializeCodeModel(File.ReadAllText(Path.Combine(basePath, "CodeModel.yaml")))); + var projectDirectory = Path.Combine(configuration.OutputFolder, Configuration.ProjectRelativeDirectory); + var project = await GeneratedCodeWorkspace.Create(projectDirectory, configuration.OutputFolder, configuration.SharedSourceFolders); + var sourceInputModel = new SourceInputModel(await project.GetCompilationAsync()); + var model = await codeModelTask; + var context = new BuildContext(model, configuration, sourceInputModel); + _ = context.Library; // gen lib + return model; + } + } +} diff --git a/test/AutoRest.TestServer.Tests/Mgmt/ResourceRenameTests.cs b/test/AutoRest.TestServer.Tests/Mgmt/ResourceRenameTests.cs new file mode 100644 index 00000000000..d3296e9e222 --- /dev/null +++ b/test/AutoRest.TestServer.Tests/Mgmt/ResourceRenameTests.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Text; +using NUnit.Framework; +using ResourceRename; + +namespace AutoRest.TestServer.Tests.Mgmt +{ + public class ResourceRenameTests + { + [Test] + public void RenamedModelExists() + { + var modelType = typeof(SshPublicKeyInfo); + Assert.NotNull(modelType); + } + + [Test] + public void OldModelDoesNotExist() + { + var modelType = typeof(SshPublicKeyInfo); + Assert.Null(modelType.Assembly.GetType("SshPublicKeyResource")); + } + } +} diff --git a/test/AutoRest.TestServer.Tests/Mgmt/TenantOnlyTests.cs b/test/AutoRest.TestServer.Tests/Mgmt/TenantOnlyTests.cs new file mode 100644 index 00000000000..014193e1f39 --- /dev/null +++ b/test/AutoRest.TestServer.Tests/Mgmt/TenantOnlyTests.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Text; +using AutoRest.CSharp.Input; +using NUnit.Framework; + +namespace AutoRest.TestServer.Tests.Mgmt +{ + internal class TenantOnlyTests : OutputLibraryTestBase + { + [Test] + public void TestTenant() + { + CodeModel model = Generate("TenantOnly").Result; + foreach (var operations in model.OperationGroups) + { + Assert.IsNotNull(operations.Parent); + if (operations.Key.Equals("AvailableBalances") || operations.Key.Equals("Instructions")) + Assert.IsTrue(operations.Parent.Equals("Microsoft.Billing/billingAccounts/billingProfiles")); + else if (operations.Key.Equals("Agreements")) + Assert.IsTrue(operations.Parent.Equals("Microsoft.Billing/billingAccounts")); + else + Assert.IsTrue(operations.Parent.Equals("tenant")); + } + } + } +} diff --git a/test/TestProjects/AdditionalPropertiesEx/Generated/Configuration.json b/test/TestProjects/AdditionalPropertiesEx/Generated/Configuration.json index 9b85e328744..7ed97e2d2f9 100644 --- a/test/TestProjects/AdditionalPropertiesEx/Generated/Configuration.json +++ b/test/TestProjects/AdditionalPropertiesEx/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"AdditionalPropertiesEx","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"AdditionalPropertiesEx","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestProjects/ExtensionClientName/Generated/Configuration.json b/test/TestProjects/ExtensionClientName/Generated/Configuration.json index 3feb9e02bb2..ab258c2cf62 100644 --- a/test/TestProjects/ExtensionClientName/Generated/Configuration.json +++ b/test/TestProjects/ExtensionClientName/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"ExtensionClientName","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"ExtensionClientName","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestProjects/HeadAsBooleanTrue/Generated/Configuration.json b/test/TestProjects/HeadAsBooleanTrue/Generated/Configuration.json index e6af24d0416..dc7e5b827c6 100644 --- a/test/TestProjects/HeadAsBooleanTrue/Generated/Configuration.json +++ b/test/TestProjects/HeadAsBooleanTrue/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"HeadAsBooleanTrue","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":true,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"HeadAsBooleanTrue","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":true,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestProjects/HeaderCollectionPrefix/Generated/Configuration.json b/test/TestProjects/HeaderCollectionPrefix/Generated/Configuration.json index 01db79852c1..48049f250b8 100644 --- a/test/TestProjects/HeaderCollectionPrefix/Generated/Configuration.json +++ b/test/TestProjects/HeaderCollectionPrefix/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"HeaderCollectionPrefix","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"HeaderCollectionPrefix","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestProjects/Inheritance/Generated/Configuration.json b/test/TestProjects/Inheritance/Generated/Configuration.json index 01b0e03b035..bb8966586e9 100644 --- a/test/TestProjects/Inheritance/Generated/Configuration.json +++ b/test/TestProjects/Inheritance/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"Inheritance","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"Inheritance","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestProjects/JsonAsBinary/Generated/Configuration.json b/test/TestProjects/JsonAsBinary/Generated/Configuration.json index db7d387f14d..964fe5a0a64 100644 --- a/test/TestProjects/JsonAsBinary/Generated/Configuration.json +++ b/test/TestProjects/JsonAsBinary/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"JsonAsBinary","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"JsonAsBinary","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestProjects/MgmtParent/Generated/AvailabilitySet.cs b/test/TestProjects/MgmtParent/Generated/AvailabilitySet.cs new file mode 100644 index 00000000000..a671a49832d --- /dev/null +++ b/test/TestProjects/MgmtParent/Generated/AvailabilitySet.cs @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace MgmtParent +{ + /// A Class representing a AvailabilitySet along with the instance operations that can be performed on it. + public class AvailabilitySet : AvailabilitySetOperations + { + } +} diff --git a/test/TestProjects/MgmtParent/Generated/AvailabilitySetContainer.cs b/test/TestProjects/MgmtParent/Generated/AvailabilitySetContainer.cs new file mode 100644 index 00000000000..9cf404d0cc2 --- /dev/null +++ b/test/TestProjects/MgmtParent/Generated/AvailabilitySetContainer.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace MgmtParent +{ + /// A class representing collection of AvailabilitySet and their operations over a [ParentResource]. + public partial class AvailabilitySetContainer + { + /// Initializes a new instance of AvailabilitySetContainer for mocking. + protected AvailabilitySetContainer() + { + } + } +} diff --git a/test/TestProjects/MgmtParent/Generated/AvailabilitySetOperations.cs b/test/TestProjects/MgmtParent/Generated/AvailabilitySetOperations.cs new file mode 100644 index 00000000000..0d4f31d2894 --- /dev/null +++ b/test/TestProjects/MgmtParent/Generated/AvailabilitySetOperations.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace MgmtParent +{ + /// A class representing the operations that can be performed over a specific AvailabilitySet. + public partial class AvailabilitySetOperations + { + /// Initializes a new instance of AvailabilitySetOperations for mocking. + protected AvailabilitySetOperations() + { + } + } +} diff --git a/test/TestProjects/MgmtParent/Generated/AvailabilitySetsRestOperations.cs b/test/TestProjects/MgmtParent/Generated/AvailabilitySetsRestOperations.cs new file mode 100644 index 00000000000..284704b8f11 --- /dev/null +++ b/test/TestProjects/MgmtParent/Generated/AvailabilitySetsRestOperations.cs @@ -0,0 +1,675 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace MgmtParent +{ + internal partial class AvailabilitySetsRestOperations + { + private string subscriptionId; + private Uri endpoint; + private string apiVersion; + private ClientDiagnostics _clientDiagnostics; + private HttpPipeline _pipeline; + + /// Initializes a new instance of AvailabilitySetsRestOperations. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// server parameter. + /// Api Version. + /// or is null. + public AvailabilitySetsRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-06-01") + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } + + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = apiVersion; + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string availabilitySetName, string bar) + { + 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.Compute/availabilitySets/", false); + uri.AppendPath(availabilitySetName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var model = new AvailabilitySetData() + { + Bar = bar + }; + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(model); + request.Content = content; + return message; + } + + /// Create or update an availability set. + /// The name of the resource group. + /// The name of the availability set. + /// specifies the bar. + /// The cancellation token to use. + /// or is null. + public async Task> CreateOrUpdateAsync(string resourceGroupName, string availabilitySetName, string bar = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (availabilitySetName == null) + { + throw new ArgumentNullException(nameof(availabilitySetName)); + } + + using var message = CreateCreateOrUpdateRequest(resourceGroupName, availabilitySetName, bar); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AvailabilitySetData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AvailabilitySetData.DeserializeAvailabilitySetData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Create or update an availability set. + /// The name of the resource group. + /// The name of the availability set. + /// specifies the bar. + /// The cancellation token to use. + /// or is null. + public Response CreateOrUpdate(string resourceGroupName, string availabilitySetName, string bar = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (availabilitySetName == null) + { + throw new ArgumentNullException(nameof(availabilitySetName)); + } + + using var message = CreateCreateOrUpdateRequest(resourceGroupName, availabilitySetName, bar); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AvailabilitySetData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AvailabilitySetData.DeserializeAvailabilitySetData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateRequest(string resourceGroupName, string availabilitySetName, string updator) + { + 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.Compute/availabilitySets/", false); + uri.AppendPath(availabilitySetName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var model = new AvailabilitySetUpdate() + { + Updator = updator + }; + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(model); + request.Content = content; + return message; + } + + /// Update an availability set. + /// The name of the resource group. + /// The name of the availability set. + /// specifies the updator. + /// The cancellation token to use. + /// or is null. + public async Task> UpdateAsync(string resourceGroupName, string availabilitySetName, string updator = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (availabilitySetName == null) + { + throw new ArgumentNullException(nameof(availabilitySetName)); + } + + using var message = CreateUpdateRequest(resourceGroupName, availabilitySetName, updator); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AvailabilitySetData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AvailabilitySetData.DeserializeAvailabilitySetData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Update an availability set. + /// The name of the resource group. + /// The name of the availability set. + /// specifies the updator. + /// The cancellation token to use. + /// or is null. + public Response Update(string resourceGroupName, string availabilitySetName, string updator = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (availabilitySetName == null) + { + throw new ArgumentNullException(nameof(availabilitySetName)); + } + + using var message = CreateUpdateRequest(resourceGroupName, availabilitySetName, updator); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AvailabilitySetData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AvailabilitySetData.DeserializeAvailabilitySetData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteRequest(string resourceGroupName, string availabilitySetName) + { + 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.Compute/availabilitySets/", false); + uri.AppendPath(availabilitySetName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + return message; + } + + /// Delete an availability set. + /// The name of the resource group. + /// The name of the availability set. + /// The cancellation token to use. + /// or is null. + public async Task DeleteAsync(string resourceGroupName, string availabilitySetName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (availabilitySetName == null) + { + throw new ArgumentNullException(nameof(availabilitySetName)); + } + + using var message = CreateDeleteRequest(resourceGroupName, availabilitySetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Delete an availability set. + /// The name of the resource group. + /// The name of the availability set. + /// The cancellation token to use. + /// or is null. + public Response Delete(string resourceGroupName, string availabilitySetName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (availabilitySetName == null) + { + throw new ArgumentNullException(nameof(availabilitySetName)); + } + + using var message = CreateDeleteRequest(resourceGroupName, availabilitySetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetRequest(string resourceGroupName, string availabilitySetName) + { + 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.Compute/availabilitySets/", false); + uri.AppendPath(availabilitySetName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Retrieves information about an availability set. + /// The name of the resource group. + /// The name of the availability set. + /// The cancellation token to use. + /// or is null. + public async Task> GetAsync(string resourceGroupName, string availabilitySetName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (availabilitySetName == null) + { + throw new ArgumentNullException(nameof(availabilitySetName)); + } + + using var message = CreateGetRequest(resourceGroupName, availabilitySetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AvailabilitySetData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AvailabilitySetData.DeserializeAvailabilitySetData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Retrieves information about an availability set. + /// The name of the resource group. + /// The name of the availability set. + /// The cancellation token to use. + /// or is null. + public Response Get(string resourceGroupName, string availabilitySetName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (availabilitySetName == null) + { + throw new ArgumentNullException(nameof(availabilitySetName)); + } + + using var message = CreateGetRequest(resourceGroupName, availabilitySetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AvailabilitySetData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AvailabilitySetData.DeserializeAvailabilitySetData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListBySubscriptionRequest(string expand) + { + 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.Compute/availabilitySets", false); + uri.AppendQuery("api-version", apiVersion, true); + if (expand != null) + { + uri.AppendQuery("$expand", expand, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Lists all availability sets in a subscription. + /// The expand expression to apply to the operation. Allowed values are 'instanceView'. + /// The cancellation token to use. + public async Task> ListBySubscriptionAsync(string expand = null, CancellationToken cancellationToken = default) + { + using var message = CreateListBySubscriptionRequest(expand); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AvailabilitySetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AvailabilitySetListResult.DeserializeAvailabilitySetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Lists all availability sets in a subscription. + /// The expand expression to apply to the operation. Allowed values are 'instanceView'. + /// The cancellation token to use. + public Response ListBySubscription(string expand = null, CancellationToken cancellationToken = default) + { + using var message = CreateListBySubscriptionRequest(expand); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AvailabilitySetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AvailabilitySetListResult.DeserializeAvailabilitySetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListRequest(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.Compute/availabilitySets", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Lists all availability sets in a resource group. + /// The name of the resource group. + /// The cancellation token to use. + /// is null. + public async Task> ListAsync(string resourceGroupName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateListRequest(resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AvailabilitySetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AvailabilitySetListResult.DeserializeAvailabilitySetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Lists all availability sets in a resource group. + /// The name of the resource group. + /// The cancellation token to use. + /// is null. + public Response List(string resourceGroupName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateListRequest(resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AvailabilitySetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AvailabilitySetListResult.DeserializeAvailabilitySetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string expand) + { + 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"); + return message; + } + + /// Lists all availability sets in a subscription. + /// The URL to the next page of results. + /// The expand expression to apply to the operation. Allowed values are 'instanceView'. + /// The cancellation token to use. + /// is null. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string expand = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, expand); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AvailabilitySetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AvailabilitySetListResult.DeserializeAvailabilitySetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Lists all availability sets in a subscription. + /// The URL to the next page of results. + /// The expand expression to apply to the operation. Allowed values are 'instanceView'. + /// The cancellation token to use. + /// is null. + public Response ListBySubscriptionNextPage(string nextLink, string expand = null, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, expand); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AvailabilitySetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AvailabilitySetListResult.DeserializeAvailabilitySetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, 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"); + return message; + } + + /// Lists all availability sets in a resource group. + /// The URL to the next page of results. + /// The name of the resource group. + /// The cancellation token to use. + /// or is null. + public async Task> ListNextPageAsync(string nextLink, string resourceGroupName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateListNextPageRequest(nextLink, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AvailabilitySetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AvailabilitySetListResult.DeserializeAvailabilitySetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Lists all availability sets in a resource group. + /// The URL to the next page of results. + /// The name of the resource group. + /// The cancellation token to use. + /// or is null. + public Response ListNextPage(string nextLink, string resourceGroupName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + + using var message = CreateListNextPageRequest(nextLink, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AvailabilitySetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AvailabilitySetListResult.DeserializeAvailabilitySetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + } +} diff --git a/test/TestProjects/MgmtParent/Generated/CodeModel.yaml b/test/TestProjects/MgmtParent/Generated/CodeModel.yaml new file mode 100644 index 00000000000..3f93d375714 --- /dev/null +++ b/test/TestProjects/MgmtParent/Generated/CodeModel.yaml @@ -0,0 +1,2230 @@ +!CodeModel +info: !Info + description: The Compute Management Client. + title: ComputeManagementClient +schemas: !Schemas + numbers: + - !NumberSchema &ref_79 + type: integer + apiVersions: + - !ApiVersion + version: '2020-06-01' + precision: 32 + language: !Languages + default: + name: Integer + description: '' + protocol: !Protocols {} + strings: + - !StringSchema &ref_0 + type: string + language: !Languages + default: + name: String + description: simple string + protocol: !Protocols {} + - !StringSchema &ref_14 + type: string + apiVersions: + - !ApiVersion + version: '2020-06-01' + language: !Languages + default: + name: String + description: '' + protocol: !Protocols {} + - !StringSchema &ref_1 + type: string + apiVersions: + - !ApiVersion + version: '2020-06-01' + language: !Languages + default: + name: AvailabilitySetBar + description: specifies the bar + protocol: !Protocols {} + - !StringSchema &ref_2 + type: string + apiVersions: + - !ApiVersion + version: '2020-06-01' + language: !Languages + default: + name: AvailabilitySetUpdateUpdator + description: specifies the updator + protocol: !Protocols {} + - !StringSchema &ref_4 + type: string + apiVersions: + - !ApiVersion + version: '2020-06-01' + language: !Languages + default: + name: AvailabilitySetListResultNextLink + description: The URI to fetch the next page of AvailabilitySets. Call ListNext() with this URI to fetch the next page of AvailabilitySets. + protocol: !Protocols {} + - !StringSchema &ref_5 + type: string + apiVersions: + - !ApiVersion + version: '2020-06-01' + language: !Languages + default: + name: DedicatedHostGroupFoo + description: specifies the foo + protocol: !Protocols {} + - !StringSchema &ref_6 + type: string + apiVersions: + - !ApiVersion + version: '2020-06-01' + language: !Languages + default: + name: DedicatedHostFoo + description: specifies the foo + protocol: !Protocols {} + - !StringSchema &ref_7 + type: string + apiVersions: + - !ApiVersion + version: '2020-06-01' + language: !Languages + default: + name: DedicatedHostUpdateUpdator + description: specifies the updator + protocol: !Protocols {} + - !StringSchema &ref_9 + type: string + apiVersions: + - !ApiVersion + version: '2020-06-01' + language: !Languages + default: + name: DedicatedHostListResultNextLink + description: The URI to fetch the next page of dedicated hosts. Call ListNext() with this URI to fetch the next page of dedicated hosts. + protocol: !Protocols {} + - !StringSchema &ref_10 + type: string + apiVersions: + - !ApiVersion + version: '2020-06-01' + language: !Languages + default: + name: VirtualMachineExtensionImageBar + description: specifies the bar + protocol: !Protocols {} + constants: + - !ConstantSchema &ref_15 + type: constant + value: !ConstantValue + value: '2020-06-01' + valueType: *ref_0 + language: !Languages + default: + name: ApiVersion20200601 + description: Api Version (2020-06-01) + protocol: !Protocols {} + - !ConstantSchema &ref_19 + type: constant + value: !ConstantValue + value: application/json + valueType: *ref_0 + language: !Languages + default: + name: ApplicationJson + description: Content Type 'application/json' + protocol: !Protocols {} + - !ConstantSchema &ref_20 + type: constant + value: !ConstantValue + value: application/json + valueType: *ref_0 + language: !Languages + default: + name: Accept + description: 'Accept: application/json' + protocol: !Protocols {} + - !ConstantSchema &ref_47 + type: constant + apiVersions: + - !ApiVersion + version: '2020-06-01' + value: !ConstantValue + value: instanceView + valueType: *ref_0 + language: !Languages + default: + name: InstanceViewTypes + description: '' + protocol: !Protocols {} + objects: + - !ObjectSchema &ref_3 + type: object + apiVersions: + - !ApiVersion + version: '2020-06-01' + properties: + - !Property &ref_22 + schema: *ref_1 + serializedName: bar + language: !Languages + default: + name: bar + description: specifies the bar + protocol: !Protocols {} + serializationFormats: + - json + usage: + - input + - output + language: !Languages + default: + name: AvailabilitySet + description: >- + Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more + information about availability sets, see [Manage the availability of virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).

For more information on Azure planned maintenance, see + [Planned maintenance for virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)

Currently, a VM + can only be added to availability set at creation time. An existing VM cannot be added to an availability set. + namespace: '' + protocol: !Protocols {} + - !ObjectSchema &ref_26 + type: object + apiVersions: + - !ApiVersion + version: '2020-06-01' + properties: + - !Property &ref_28 + schema: *ref_2 + serializedName: updator + language: !Languages + default: + name: updator + description: specifies the updator + protocol: !Protocols {} + serializationFormats: + - json + usage: + - input + language: !Languages + default: + name: AvailabilitySetUpdate + description: >- + Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more + information about availability sets, see [Manage the availability of virtual + machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).

For more information on Azure planned maintenance, see + [Planned maintenance for virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)

Currently, a VM + can only be added to availability set at creation time. An existing VM cannot be added to an availability set. + namespace: '' + protocol: !Protocols {} + - !ObjectSchema &ref_37 + type: object + apiVersions: + - !ApiVersion + version: '2020-06-01' + properties: + - !Property + schema: !ArraySchema &ref_11 + type: array + apiVersions: + - !ApiVersion + version: '2020-06-01' + elementType: *ref_3 + language: !Languages + default: + name: AvailabilitySetListResultValue + description: The list of availability sets + protocol: !Protocols {} + required: true + serializedName: value + language: !Languages + default: + name: value + description: The list of availability sets + protocol: !Protocols {} + - !Property + schema: *ref_4 + required: false + serializedName: nextLink + language: !Languages + default: + name: nextLink + description: The URI to fetch the next page of AvailabilitySets. Call ListNext() with this URI to fetch the next page of AvailabilitySets. + protocol: !Protocols {} + serializationFormats: + - json + usage: + - output + language: !Languages + default: + name: AvailabilitySetListResult + description: The List Availability Set operation response. + namespace: '' + protocol: !Protocols {} + - !ObjectSchema &ref_39 + type: object + apiVersions: + - !ApiVersion + version: '2020-06-01' + properties: + - !Property &ref_41 + schema: *ref_5 + serializedName: foo + language: !Languages + default: + name: foo + description: specifies the foo + protocol: !Protocols {} + serializationFormats: + - json + usage: + - input + - output + language: !Languages + default: + name: DedicatedHostGroup + description: Specifies information about the Dedicated host. + namespace: '' + protocol: !Protocols {} + - !ObjectSchema &ref_8 + type: object + apiVersions: + - !ApiVersion + version: '2020-06-01' + properties: + - !Property &ref_51 + schema: *ref_6 + serializedName: foo + language: !Languages + default: + name: foo + description: specifies the foo + protocol: !Protocols {} + serializationFormats: + - json + usage: + - input + - output + language: !Languages + default: + name: DedicatedHost + description: Specifies information about the Dedicated host. + namespace: '' + protocol: !Protocols {} + - !ObjectSchema &ref_56 + type: object + apiVersions: + - !ApiVersion + version: '2020-06-01' + properties: + - !Property &ref_58 + schema: *ref_7 + serializedName: updator + language: !Languages + default: + name: updator + description: specifies the updator + protocol: !Protocols {} + serializationFormats: + - json + usage: + - input + language: !Languages + default: + name: DedicatedHostUpdate + description: Specifies information about the Dedicated host. + namespace: '' + protocol: !Protocols {} + - !ObjectSchema &ref_71 + type: object + apiVersions: + - !ApiVersion + version: '2020-06-01' + properties: + - !Property + schema: !ArraySchema &ref_12 + type: array + apiVersions: + - !ApiVersion + version: '2020-06-01' + elementType: *ref_8 + language: !Languages + default: + name: DedicatedHostListResultValue + description: The list of dedicated hosts + protocol: !Protocols {} + required: true + serializedName: value + language: !Languages + default: + name: value + description: The list of dedicated hosts + protocol: !Protocols {} + - !Property + schema: *ref_9 + required: false + serializedName: nextLink + language: !Languages + default: + name: nextLink + description: The URI to fetch the next page of dedicated hosts. Call ListNext() with this URI to fetch the next page of dedicated hosts. + protocol: !Protocols {} + serializationFormats: + - json + usage: + - output + language: !Languages + default: + name: DedicatedHostListResult + description: The list dedicated host operation response. + namespace: '' + protocol: !Protocols {} + - !ObjectSchema &ref_13 + type: object + apiVersions: + - !ApiVersion + version: '2020-06-01' + properties: + - !Property + schema: *ref_10 + serializedName: bar + language: !Languages + default: + name: bar + description: specifies the bar + protocol: !Protocols {} + serializationFormats: + - json + usage: + - output + language: !Languages + default: + name: VirtualMachineExtensionImage + description: The VirtualMachineExtensionImage. + namespace: '' + protocol: !Protocols {} + arrays: + - *ref_11 + - *ref_12 + - !ArraySchema &ref_78 + type: array + apiVersions: + - !ApiVersion + version: '2020-06-01' + elementType: *ref_13 + language: !Languages + default: + name: ArrayOfVirtualMachineExtensionImage + description: Array of VirtualMachineExtensionImage + protocol: !Protocols {} + - !ArraySchema &ref_86 + type: array + apiVersions: + - !ApiVersion + version: '2020-06-01' + elementType: *ref_13 + language: !Languages + default: + name: ArrayOfVirtualMachineExtensionImage + description: Array of VirtualMachineExtensionImage + protocol: !Protocols {} +globalParameters: + - !Parameter &ref_18 + schema: *ref_14 + implementation: Client + required: true + extensions: + x-ms-priority: 0 + language: !Languages + default: + name: SubscriptionId + description: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + serializedName: subscriptionId + protocol: !Protocols + http: !HttpParameter + in: path + - !Parameter &ref_16 + schema: *ref_0 + clientDefaultValue: https://management.azure.com + implementation: Client + origin: modelerfour:synthesized/host + required: true + extensions: + x-ms-skip-url-encoding: true + language: !Languages + default: + name: $host + description: server parameter + serializedName: $host + protocol: !Protocols + http: !HttpParameter + in: uri + - !Parameter &ref_17 + schema: *ref_15 + implementation: Client + origin: modelerfour:synthesized/api-version + required: true + language: !Languages + default: + name: apiVersion + description: Api Version + serializedName: api-version + protocol: !Protocols + http: !HttpParameter + in: query +operationGroups: + - !OperationGroup + $key: AvailabilitySets + operations: + - !Operation + apiVersions: + - !ApiVersion + version: '2020-06-01' + parameters: + - *ref_16 + - !Parameter &ref_24 + schema: *ref_14 + implementation: Method + required: true + language: !Languages + default: + name: resourceGroupName + description: The name of the resource group. + serializedName: resourceGroupName + protocol: !Protocols + http: !HttpParameter + in: path + - !Parameter &ref_25 + schema: *ref_14 + implementation: Method + required: true + language: !Languages + default: + name: availabilitySetName + description: The name of the availability set. + serializedName: availabilitySetName + protocol: !Protocols + http: !HttpParameter + in: path + - *ref_17 + - *ref_18 + requests: + - !Request + parameters: + - !Parameter + schema: *ref_19 + implementation: Method + origin: modelerfour:synthesized/content-type + required: true + language: !Languages + default: + name: contentType + description: Body Parameter content-type + serializedName: Content-Type + protocol: !Protocols + http: !HttpParameter + in: header + - !Parameter &ref_21 + schema: *ref_3 + flattened: true + implementation: Method + required: true + language: !Languages + default: + name: parameters + description: Parameters supplied to the Create Availability Set operation. + protocol: !Protocols + http: !HttpParameter + in: body + style: json + - !Parameter + schema: *ref_20 + implementation: Method + origin: modelerfour:synthesized/accept + required: true + language: !Languages + default: + name: accept + description: Accept header + serializedName: Accept + protocol: !Protocols + http: !HttpParameter + in: header + - !VirtualParameter &ref_23 + schema: *ref_1 + implementation: Method + originalParameter: *ref_21 + pathToProperty: [] + targetProperty: *ref_22 + language: !Languages + default: + name: bar + description: specifies the bar + protocol: !Protocols {} + signatureParameters: + - *ref_23 + language: !Languages + default: + name: '' + description: '' + protocol: !Protocols + http: !HttpWithBodyRequest + path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName} + method: put + knownMediaType: json + mediaTypes: + - application/json + uri: '{$host}' + signatureParameters: + - *ref_24 + - *ref_25 + responses: + - !SchemaResponse + schema: *ref_3 + language: !Languages + default: + name: '' + description: OK + protocol: !Protocols + http: !HttpResponse + knownMediaType: json + mediaTypes: + - application/json + statusCodes: + - '200' + language: !Languages + default: + name: CreateOrUpdate + description: Create or update an availability set. + protocol: !Protocols {} + - !Operation + apiVersions: + - !ApiVersion + version: '2020-06-01' + parameters: + - *ref_16 + - !Parameter &ref_30 + schema: *ref_14 + implementation: Method + required: true + language: !Languages + default: + name: resourceGroupName + description: The name of the resource group. + serializedName: resourceGroupName + protocol: !Protocols + http: !HttpParameter + in: path + - !Parameter &ref_31 + schema: *ref_14 + implementation: Method + required: true + language: !Languages + default: + name: availabilitySetName + description: The name of the availability set. + serializedName: availabilitySetName + protocol: !Protocols + http: !HttpParameter + in: path + - *ref_17 + - *ref_18 + requests: + - !Request + parameters: + - !Parameter + schema: *ref_19 + implementation: Method + origin: modelerfour:synthesized/content-type + required: true + language: !Languages + default: + name: contentType + description: Body Parameter content-type + serializedName: Content-Type + protocol: !Protocols + http: !HttpParameter + in: header + - !Parameter &ref_27 + schema: *ref_26 + flattened: true + implementation: Method + required: true + language: !Languages + default: + name: parameters + description: Parameters supplied to the Update Availability Set operation. + protocol: !Protocols + http: !HttpParameter + in: body + style: json + - !Parameter + schema: *ref_20 + implementation: Method + origin: modelerfour:synthesized/accept + required: true + language: !Languages + default: + name: accept + description: Accept header + serializedName: Accept + protocol: !Protocols + http: !HttpParameter + in: header + - !VirtualParameter &ref_29 + schema: *ref_2 + implementation: Method + originalParameter: *ref_27 + pathToProperty: [] + targetProperty: *ref_28 + language: !Languages + default: + name: updator + description: specifies the updator + protocol: !Protocols {} + signatureParameters: + - *ref_29 + language: !Languages + default: + name: '' + description: '' + protocol: !Protocols + http: !HttpWithBodyRequest + path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName} + method: patch + knownMediaType: json + mediaTypes: + - application/json + uri: '{$host}' + signatureParameters: + - *ref_30 + - *ref_31 + responses: + - !SchemaResponse + schema: *ref_3 + language: !Languages + default: + name: '' + description: OK + protocol: !Protocols + http: !HttpResponse + knownMediaType: json + mediaTypes: + - application/json + statusCodes: + - '200' + language: !Languages + default: + name: Update + description: Update an availability set. + protocol: !Protocols {} + - !Operation + apiVersions: + - !ApiVersion + version: '2020-06-01' + parameters: + - *ref_16 + - !Parameter &ref_32 + schema: *ref_14 + implementation: Method + required: true + language: !Languages + default: + name: resourceGroupName + description: The name of the resource group. + serializedName: resourceGroupName + protocol: !Protocols + http: !HttpParameter + in: path + - !Parameter &ref_33 + schema: *ref_14 + implementation: Method + required: true + language: !Languages + default: + name: availabilitySetName + description: The name of the availability set. + serializedName: availabilitySetName + protocol: !Protocols + http: !HttpParameter + in: path + - *ref_17 + - *ref_18 + requests: + - !Request + language: !Languages + default: + name: '' + description: '' + protocol: !Protocols + http: !HttpRequest + path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName} + method: delete + uri: '{$host}' + signatureParameters: + - *ref_32 + - *ref_33 + responses: + - !Response + language: !Languages + default: + name: '' + description: OK + protocol: !Protocols + http: !HttpResponse + statusCodes: + - '200' + - !Response + language: !Languages + default: + name: '' + description: No Content + protocol: !Protocols + http: !HttpResponse + statusCodes: + - '204' + language: !Languages + default: + name: Delete + description: Delete an availability set. + protocol: !Protocols {} + - !Operation + apiVersions: + - !ApiVersion + version: '2020-06-01' + parameters: + - *ref_16 + - !Parameter &ref_34 + schema: *ref_14 + implementation: Method + required: true + language: !Languages + default: + name: resourceGroupName + description: The name of the resource group. + serializedName: resourceGroupName + protocol: !Protocols + http: !HttpParameter + in: path + - !Parameter &ref_35 + schema: *ref_14 + implementation: Method + required: true + language: !Languages + default: + name: availabilitySetName + description: The name of the availability set. + serializedName: availabilitySetName + protocol: !Protocols + http: !HttpParameter + in: path + - *ref_17 + - *ref_18 + requests: + - !Request + parameters: + - !Parameter + schema: *ref_20 + implementation: Method + origin: modelerfour:synthesized/accept + required: true + language: !Languages + default: + name: accept + description: Accept header + serializedName: Accept + protocol: !Protocols + http: !HttpParameter + in: header + signatureParameters: [] + language: !Languages + default: + name: '' + description: '' + protocol: !Protocols + http: !HttpRequest + path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName} + method: get + uri: '{$host}' + signatureParameters: + - *ref_34 + - *ref_35 + responses: + - !SchemaResponse + schema: *ref_3 + language: !Languages + default: + name: '' + description: OK + protocol: !Protocols + http: !HttpResponse + knownMediaType: json + mediaTypes: + - application/json + statusCodes: + - '200' + language: !Languages + default: + name: Get + description: Retrieves information about an availability set. + protocol: !Protocols {} + - !Operation + apiVersions: + - !ApiVersion + version: '2020-06-01' + parameters: + - *ref_16 + - *ref_17 + - *ref_18 + - !Parameter &ref_36 + schema: *ref_14 + implementation: Method + language: !Languages + default: + name: expand + description: The expand expression to apply to the operation. Allowed values are 'instanceView'. + serializedName: $expand + protocol: !Protocols + http: !HttpParameter + in: query + requests: + - !Request + parameters: + - !Parameter + schema: *ref_20 + implementation: Method + origin: modelerfour:synthesized/accept + required: true + language: !Languages + default: + name: accept + description: Accept header + serializedName: Accept + protocol: !Protocols + http: !HttpParameter + in: header + signatureParameters: [] + language: !Languages + default: + name: '' + description: '' + protocol: !Protocols + http: !HttpRequest + path: /subscriptions/{subscriptionId}/providers/Microsoft.Compute/availabilitySets + method: get + uri: '{$host}' + signatureParameters: + - *ref_36 + responses: + - !SchemaResponse + schema: *ref_37 + language: !Languages + default: + name: '' + description: OK + protocol: !Protocols + http: !HttpResponse + knownMediaType: json + mediaTypes: + - application/json + statusCodes: + - '200' + extensions: + x-ms-pageable: + nextLinkName: nextLink + language: !Languages + default: + name: ListBySubscription + description: Lists all availability sets in a subscription. + paging: + nextLinkName: nextLink + protocol: !Protocols {} + - !Operation + apiVersions: + - !ApiVersion + version: '2020-06-01' + parameters: + - *ref_16 + - !Parameter &ref_38 + schema: *ref_14 + implementation: Method + required: true + language: !Languages + default: + name: resourceGroupName + description: The name of the resource group. + serializedName: resourceGroupName + protocol: !Protocols + http: !HttpParameter + in: path + - *ref_17 + - *ref_18 + requests: + - !Request + parameters: + - !Parameter + schema: *ref_20 + implementation: Method + origin: modelerfour:synthesized/accept + required: true + language: !Languages + default: + name: accept + description: Accept header + serializedName: Accept + protocol: !Protocols + http: !HttpParameter + in: header + signatureParameters: [] + language: !Languages + default: + name: '' + description: '' + protocol: !Protocols + http: !HttpRequest + path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets + method: get + uri: '{$host}' + signatureParameters: + - *ref_38 + responses: + - !SchemaResponse + schema: *ref_37 + language: !Languages + default: + name: '' + description: OK + protocol: !Protocols + http: !HttpResponse + knownMediaType: json + mediaTypes: + - application/json + statusCodes: + - '200' + extensions: + x-ms-pageable: + nextLinkName: nextLink + language: !Languages + default: + name: List + description: Lists all availability sets in a resource group. + paging: + nextLinkName: nextLink + protocol: !Protocols {} + language: !Languages + default: + name: AvailabilitySets + description: '' + protocol: !Protocols {} + - !OperationGroup + $key: DedicatedHostGroups + operations: + - !Operation + apiVersions: + - !ApiVersion + version: '2020-06-01' + parameters: + - *ref_16 + - !Parameter &ref_43 + schema: *ref_14 + implementation: Method + required: true + language: !Languages + default: + name: resourceGroupName + description: The name of the resource group. + serializedName: resourceGroupName + protocol: !Protocols + http: !HttpParameter + in: path + - !Parameter &ref_44 + schema: *ref_14 + implementation: Method + required: true + language: !Languages + default: + name: hostGroupName + description: The name of the dedicated host group. + serializedName: hostGroupName + protocol: !Protocols + http: !HttpParameter + in: path + - *ref_17 + - *ref_18 + requests: + - !Request + parameters: + - !Parameter + schema: *ref_19 + implementation: Method + origin: modelerfour:synthesized/content-type + required: true + language: !Languages + default: + name: contentType + description: Body Parameter content-type + serializedName: Content-Type + protocol: !Protocols + http: !HttpParameter + in: header + - !Parameter &ref_40 + schema: *ref_39 + flattened: true + implementation: Method + required: true + language: !Languages + default: + name: parameters + description: Parameters supplied to the Create Dedicated Host Group. + protocol: !Protocols + http: !HttpParameter + in: body + style: json + - !Parameter + schema: *ref_20 + implementation: Method + origin: modelerfour:synthesized/accept + required: true + language: !Languages + default: + name: accept + description: Accept header + serializedName: Accept + protocol: !Protocols + http: !HttpParameter + in: header + - !VirtualParameter &ref_42 + schema: *ref_5 + implementation: Method + originalParameter: *ref_40 + pathToProperty: [] + targetProperty: *ref_41 + language: !Languages + default: + name: foo + description: specifies the foo + protocol: !Protocols {} + signatureParameters: + - *ref_42 + language: !Languages + default: + name: '' + description: '' + protocol: !Protocols + http: !HttpWithBodyRequest + path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName} + method: put + knownMediaType: json + mediaTypes: + - application/json + uri: '{$host}' + signatureParameters: + - *ref_43 + - *ref_44 + responses: + - !SchemaResponse + schema: *ref_39 + language: !Languages + default: + name: '' + description: OK + protocol: !Protocols + http: !HttpResponse + knownMediaType: json + mediaTypes: + - application/json + statusCodes: + - '200' + - !SchemaResponse + schema: *ref_39 + language: !Languages + default: + name: '' + description: Created + protocol: !Protocols + http: !HttpResponse + knownMediaType: json + mediaTypes: + - application/json + statusCodes: + - '201' + language: !Languages + default: + name: CreateOrUpdate + description: Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596) + protocol: !Protocols {} + - !Operation + apiVersions: + - !ApiVersion + version: '2020-06-01' + parameters: + - *ref_16 + - !Parameter &ref_45 + schema: *ref_14 + implementation: Method + required: true + language: !Languages + default: + name: resourceGroupName + description: The name of the resource group. + serializedName: resourceGroupName + protocol: !Protocols + http: !HttpParameter + in: path + - !Parameter &ref_46 + schema: *ref_14 + implementation: Method + required: true + language: !Languages + default: + name: hostGroupName + description: The name of the dedicated host group. + serializedName: hostGroupName + protocol: !Protocols + http: !HttpParameter + in: path + - *ref_17 + - *ref_18 + requests: + - !Request + language: !Languages + default: + name: '' + description: '' + protocol: !Protocols + http: !HttpRequest + path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName} + method: delete + uri: '{$host}' + signatureParameters: + - *ref_45 + - *ref_46 + responses: + - !Response + language: !Languages + default: + name: '' + description: OK + protocol: !Protocols + http: !HttpResponse + statusCodes: + - '200' + - !Response + language: !Languages + default: + name: '' + description: No Content + protocol: !Protocols + http: !HttpResponse + statusCodes: + - '204' + language: !Languages + default: + name: Delete + description: Delete a dedicated host group. + protocol: !Protocols {} + - !Operation + apiVersions: + - !ApiVersion + version: '2020-06-01' + parameters: + - *ref_16 + - !Parameter &ref_48 + schema: *ref_14 + implementation: Method + required: true + language: !Languages + default: + name: resourceGroupName + description: The name of the resource group. + serializedName: resourceGroupName + protocol: !Protocols + http: !HttpParameter + in: path + - !Parameter &ref_49 + schema: *ref_14 + implementation: Method + required: true + language: !Languages + default: + name: hostGroupName + description: The name of the dedicated host group. + serializedName: hostGroupName + protocol: !Protocols + http: !HttpParameter + in: path + - !Parameter + schema: *ref_47 + implementation: Method + language: !Languages + default: + name: expand + description: The expand expression to apply on the operation. The response shows the list of instance view of the dedicated hosts under the dedicated host group. + serializedName: $expand + protocol: !Protocols + http: !HttpParameter + in: query + - *ref_17 + - *ref_18 + requests: + - !Request + parameters: + - !Parameter + schema: *ref_20 + implementation: Method + origin: modelerfour:synthesized/accept + required: true + language: !Languages + default: + name: accept + description: Accept header + serializedName: Accept + protocol: !Protocols + http: !HttpParameter + in: header + signatureParameters: [] + language: !Languages + default: + name: '' + description: '' + protocol: !Protocols + http: !HttpRequest + path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName} + method: get + uri: '{$host}' + signatureParameters: + - *ref_48 + - *ref_49 + responses: + - !SchemaResponse + schema: *ref_39 + language: !Languages + default: + name: '' + description: OK + protocol: !Protocols + http: !HttpResponse + knownMediaType: json + mediaTypes: + - application/json + statusCodes: + - '200' + language: !Languages + default: + name: Get + description: Retrieves information about a dedicated host group. + protocol: !Protocols {} + language: !Languages + default: + name: DedicatedHostGroups + description: '' + protocol: !Protocols {} + - !OperationGroup + $key: DedicatedHosts + operations: + - !Operation + apiVersions: + - !ApiVersion + version: '2020-06-01' + parameters: + - *ref_16 + - !Parameter &ref_53 + schema: *ref_14 + implementation: Method + required: true + language: !Languages + default: + name: resourceGroupName + description: The name of the resource group. + serializedName: resourceGroupName + protocol: !Protocols + http: !HttpParameter + in: path + - !Parameter &ref_54 + schema: *ref_14 + implementation: Method + required: true + language: !Languages + default: + name: hostGroupName + description: The name of the dedicated host group. + serializedName: hostGroupName + protocol: !Protocols + http: !HttpParameter + in: path + - !Parameter &ref_55 + schema: *ref_14 + implementation: Method + required: true + language: !Languages + default: + name: hostName + description: The name of the dedicated host . + serializedName: hostName + protocol: !Protocols + http: !HttpParameter + in: path + - *ref_17 + - *ref_18 + requests: + - !Request + parameters: + - !Parameter + schema: *ref_19 + implementation: Method + origin: modelerfour:synthesized/content-type + required: true + language: !Languages + default: + name: contentType + description: Body Parameter content-type + serializedName: Content-Type + protocol: !Protocols + http: !HttpParameter + in: header + - !Parameter &ref_50 + schema: *ref_8 + flattened: true + implementation: Method + required: true + language: !Languages + default: + name: parameters + description: Parameters supplied to the Create Dedicated Host. + protocol: !Protocols + http: !HttpParameter + in: body + style: json + - !Parameter + schema: *ref_20 + implementation: Method + origin: modelerfour:synthesized/accept + required: true + language: !Languages + default: + name: accept + description: Accept header + serializedName: Accept + protocol: !Protocols + http: !HttpParameter + in: header + - !VirtualParameter &ref_52 + schema: *ref_6 + implementation: Method + originalParameter: *ref_50 + pathToProperty: [] + targetProperty: *ref_51 + language: !Languages + default: + name: foo + description: specifies the foo + protocol: !Protocols {} + signatureParameters: + - *ref_52 + language: !Languages + default: + name: '' + description: '' + protocol: !Protocols + http: !HttpWithBodyRequest + path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName} + method: put + knownMediaType: json + mediaTypes: + - application/json + uri: '{$host}' + signatureParameters: + - *ref_53 + - *ref_54 + - *ref_55 + responses: + - !SchemaResponse + schema: *ref_8 + language: !Languages + default: + name: '' + description: OK + protocol: !Protocols + http: !HttpResponse + knownMediaType: json + mediaTypes: + - application/json + statusCodes: + - '200' + - !SchemaResponse + schema: *ref_8 + language: !Languages + default: + name: '' + description: Created + protocol: !Protocols + http: !HttpResponse + knownMediaType: json + mediaTypes: + - application/json + statusCodes: + - '201' + extensions: + x-ms-long-running-operation: true + language: !Languages + default: + name: CreateOrUpdate + description: Create or update a dedicated host . + protocol: !Protocols {} + - !Operation + apiVersions: + - !ApiVersion + version: '2020-06-01' + parameters: + - *ref_16 + - !Parameter &ref_60 + schema: *ref_14 + implementation: Method + required: true + language: !Languages + default: + name: resourceGroupName + description: The name of the resource group. + serializedName: resourceGroupName + protocol: !Protocols + http: !HttpParameter + in: path + - !Parameter &ref_61 + schema: *ref_14 + implementation: Method + required: true + language: !Languages + default: + name: hostGroupName + description: The name of the dedicated host group. + serializedName: hostGroupName + protocol: !Protocols + http: !HttpParameter + in: path + - !Parameter &ref_62 + schema: *ref_14 + implementation: Method + required: true + language: !Languages + default: + name: hostName + description: The name of the dedicated host . + serializedName: hostName + protocol: !Protocols + http: !HttpParameter + in: path + - *ref_17 + - *ref_18 + requests: + - !Request + parameters: + - !Parameter + schema: *ref_19 + implementation: Method + origin: modelerfour:synthesized/content-type + required: true + language: !Languages + default: + name: contentType + description: Body Parameter content-type + serializedName: Content-Type + protocol: !Protocols + http: !HttpParameter + in: header + - !Parameter &ref_57 + schema: *ref_56 + flattened: true + implementation: Method + required: true + language: !Languages + default: + name: parameters + description: Parameters supplied to the Update Dedicated Host operation. + protocol: !Protocols + http: !HttpParameter + in: body + style: json + - !Parameter + schema: *ref_20 + implementation: Method + origin: modelerfour:synthesized/accept + required: true + language: !Languages + default: + name: accept + description: Accept header + serializedName: Accept + protocol: !Protocols + http: !HttpParameter + in: header + - !VirtualParameter &ref_59 + schema: *ref_7 + implementation: Method + originalParameter: *ref_57 + pathToProperty: [] + targetProperty: *ref_58 + language: !Languages + default: + name: updator + description: specifies the updator + protocol: !Protocols {} + signatureParameters: + - *ref_59 + language: !Languages + default: + name: '' + description: '' + protocol: !Protocols + http: !HttpWithBodyRequest + path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName} + method: patch + knownMediaType: json + mediaTypes: + - application/json + uri: '{$host}' + signatureParameters: + - *ref_60 + - *ref_61 + - *ref_62 + responses: + - !SchemaResponse + schema: *ref_8 + language: !Languages + default: + name: '' + description: OK + protocol: !Protocols + http: !HttpResponse + knownMediaType: json + mediaTypes: + - application/json + statusCodes: + - '200' + extensions: + x-ms-long-running-operation: true + language: !Languages + default: + name: Update + description: Update an dedicated host . + protocol: !Protocols {} + - !Operation + apiVersions: + - !ApiVersion + version: '2020-06-01' + parameters: + - *ref_16 + - !Parameter &ref_63 + schema: *ref_14 + implementation: Method + required: true + language: !Languages + default: + name: resourceGroupName + description: The name of the resource group. + serializedName: resourceGroupName + protocol: !Protocols + http: !HttpParameter + in: path + - !Parameter &ref_64 + schema: *ref_14 + implementation: Method + required: true + language: !Languages + default: + name: hostGroupName + description: The name of the dedicated host group. + serializedName: hostGroupName + protocol: !Protocols + http: !HttpParameter + in: path + - !Parameter &ref_65 + schema: *ref_14 + implementation: Method + required: true + language: !Languages + default: + name: hostName + description: The name of the dedicated host. + serializedName: hostName + protocol: !Protocols + http: !HttpParameter + in: path + - *ref_17 + - *ref_18 + requests: + - !Request + language: !Languages + default: + name: '' + description: '' + protocol: !Protocols + http: !HttpRequest + path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName} + method: delete + uri: '{$host}' + signatureParameters: + - *ref_63 + - *ref_64 + - *ref_65 + responses: + - !Response + language: !Languages + default: + name: '' + description: OK + protocol: !Protocols + http: !HttpResponse + statusCodes: + - '200' + - !Response + language: !Languages + default: + name: '' + description: Accepted + protocol: !Protocols + http: !HttpResponse + statusCodes: + - '202' + - !Response + language: !Languages + default: + name: '' + description: No Content + protocol: !Protocols + http: !HttpResponse + statusCodes: + - '204' + extensions: + x-ms-long-running-operation: true + language: !Languages + default: + name: Delete + description: Delete a dedicated host. + protocol: !Protocols {} + - !Operation + apiVersions: + - !ApiVersion + version: '2020-06-01' + parameters: + - *ref_16 + - !Parameter &ref_66 + schema: *ref_14 + implementation: Method + required: true + language: !Languages + default: + name: resourceGroupName + description: The name of the resource group. + serializedName: resourceGroupName + protocol: !Protocols + http: !HttpParameter + in: path + - !Parameter &ref_67 + schema: *ref_14 + implementation: Method + required: true + language: !Languages + default: + name: hostGroupName + description: The name of the dedicated host group. + serializedName: hostGroupName + protocol: !Protocols + http: !HttpParameter + in: path + - !Parameter &ref_68 + schema: *ref_14 + implementation: Method + required: true + language: !Languages + default: + name: hostName + description: The name of the dedicated host. + serializedName: hostName + protocol: !Protocols + http: !HttpParameter + in: path + - !Parameter + schema: *ref_47 + implementation: Method + language: !Languages + default: + name: expand + description: The expand expression to apply on the operation. + serializedName: $expand + protocol: !Protocols + http: !HttpParameter + in: query + - *ref_17 + - *ref_18 + requests: + - !Request + parameters: + - !Parameter + schema: *ref_20 + implementation: Method + origin: modelerfour:synthesized/accept + required: true + language: !Languages + default: + name: accept + description: Accept header + serializedName: Accept + protocol: !Protocols + http: !HttpParameter + in: header + signatureParameters: [] + language: !Languages + default: + name: '' + description: '' + protocol: !Protocols + http: !HttpRequest + path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName} + method: get + uri: '{$host}' + signatureParameters: + - *ref_66 + - *ref_67 + - *ref_68 + responses: + - !SchemaResponse + schema: *ref_8 + language: !Languages + default: + name: '' + description: OK + protocol: !Protocols + http: !HttpResponse + knownMediaType: json + mediaTypes: + - application/json + statusCodes: + - '200' + language: !Languages + default: + name: Get + description: Retrieves information about a dedicated host. + protocol: !Protocols {} + - !Operation + apiVersions: + - !ApiVersion + version: '2020-06-01' + parameters: + - *ref_16 + - !Parameter &ref_69 + schema: *ref_14 + implementation: Method + required: true + language: !Languages + default: + name: resourceGroupName + description: The name of the resource group. + serializedName: resourceGroupName + protocol: !Protocols + http: !HttpParameter + in: path + - !Parameter &ref_70 + schema: *ref_14 + implementation: Method + required: true + language: !Languages + default: + name: hostGroupName + description: The name of the dedicated host group. + serializedName: hostGroupName + protocol: !Protocols + http: !HttpParameter + in: path + - *ref_17 + - *ref_18 + requests: + - !Request + parameters: + - !Parameter + schema: *ref_20 + implementation: Method + origin: modelerfour:synthesized/accept + required: true + language: !Languages + default: + name: accept + description: Accept header + serializedName: Accept + protocol: !Protocols + http: !HttpParameter + in: header + signatureParameters: [] + language: !Languages + default: + name: '' + description: '' + protocol: !Protocols + http: !HttpRequest + path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts + method: get + uri: '{$host}' + signatureParameters: + - *ref_69 + - *ref_70 + responses: + - !SchemaResponse + schema: *ref_71 + language: !Languages + default: + name: '' + description: OK + protocol: !Protocols + http: !HttpResponse + knownMediaType: json + mediaTypes: + - application/json + statusCodes: + - '200' + extensions: + x-ms-pageable: + nextLinkName: nextLink + language: !Languages + default: + name: ListByHostGroup + description: Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. + paging: + nextLinkName: nextLink + protocol: !Protocols {} + language: !Languages + default: + name: DedicatedHosts + description: '' + protocol: !Protocols {} + - !OperationGroup + $key: VirtualMachineExtensionImages + operations: + - !Operation + apiVersions: + - !ApiVersion + version: '2020-06-01' + parameters: + - *ref_16 + - !Parameter &ref_72 + schema: *ref_14 + implementation: Method + required: true + language: !Languages + default: + name: location + description: The name of a supported Azure region. + serializedName: location + protocol: !Protocols + http: !HttpParameter + in: path + - !Parameter &ref_73 + schema: *ref_14 + implementation: Method + required: true + language: !Languages + default: + name: publisherName + description: '' + serializedName: publisherName + protocol: !Protocols + http: !HttpParameter + in: path + - !Parameter &ref_74 + schema: *ref_14 + implementation: Method + required: true + language: !Languages + default: + name: type + description: '' + serializedName: type + protocol: !Protocols + http: !HttpParameter + in: path + - !Parameter &ref_75 + schema: *ref_14 + implementation: Method + required: true + language: !Languages + default: + name: version + description: '' + serializedName: version + protocol: !Protocols + http: !HttpParameter + in: path + - *ref_17 + - *ref_18 + requests: + - !Request + parameters: + - !Parameter + schema: *ref_20 + implementation: Method + origin: modelerfour:synthesized/accept + required: true + language: !Languages + default: + name: accept + description: Accept header + serializedName: Accept + protocol: !Protocols + http: !HttpParameter + in: header + signatureParameters: [] + language: !Languages + default: + name: '' + description: '' + protocol: !Protocols + http: !HttpRequest + path: /subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version} + method: get + uri: '{$host}' + signatureParameters: + - *ref_72 + - *ref_73 + - *ref_74 + - *ref_75 + responses: + - !SchemaResponse + schema: *ref_13 + language: !Languages + default: + name: '' + description: OK + protocol: !Protocols + http: !HttpResponse + knownMediaType: json + mediaTypes: + - application/json + statusCodes: + - '200' + language: !Languages + default: + name: Get + description: Gets a virtual machine extension image. + protocol: !Protocols {} + - !Operation + apiVersions: + - !ApiVersion + version: '2020-06-01' + parameters: + - *ref_16 + - !Parameter &ref_76 + schema: *ref_14 + implementation: Method + required: true + language: !Languages + default: + name: location + description: The name of a supported Azure region. + serializedName: location + protocol: !Protocols + http: !HttpParameter + in: path + - !Parameter &ref_77 + schema: *ref_14 + implementation: Method + required: true + language: !Languages + default: + name: publisherName + description: '' + serializedName: publisherName + protocol: !Protocols + http: !HttpParameter + in: path + - *ref_17 + - *ref_18 + requests: + - !Request + parameters: + - !Parameter + schema: *ref_20 + implementation: Method + origin: modelerfour:synthesized/accept + required: true + language: !Languages + default: + name: accept + description: Accept header + serializedName: Accept + protocol: !Protocols + http: !HttpParameter + in: header + signatureParameters: [] + language: !Languages + default: + name: '' + description: '' + protocol: !Protocols + http: !HttpRequest + path: /subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types + method: get + uri: '{$host}' + signatureParameters: + - *ref_76 + - *ref_77 + responses: + - !SchemaResponse + schema: *ref_78 + language: !Languages + default: + name: '' + description: OK + protocol: !Protocols + http: !HttpResponse + knownMediaType: json + mediaTypes: + - application/json + statusCodes: + - '200' + language: !Languages + default: + name: ListTypes + description: Gets a list of virtual machine extension image types. + protocol: !Protocols {} + - !Operation + apiVersions: + - !ApiVersion + version: '2020-06-01' + parameters: + - *ref_16 + - !Parameter &ref_80 + schema: *ref_14 + implementation: Method + required: true + language: !Languages + default: + name: location + description: The name of a supported Azure region. + serializedName: location + protocol: !Protocols + http: !HttpParameter + in: path + - !Parameter &ref_81 + schema: *ref_14 + implementation: Method + required: true + language: !Languages + default: + name: publisherName + description: '' + serializedName: publisherName + protocol: !Protocols + http: !HttpParameter + in: path + - !Parameter &ref_82 + schema: *ref_14 + implementation: Method + required: true + language: !Languages + default: + name: type + description: '' + serializedName: type + protocol: !Protocols + http: !HttpParameter + in: path + - !Parameter &ref_83 + schema: *ref_14 + implementation: Method + language: !Languages + default: + name: filter + description: The filter to apply on the operation. + serializedName: $filter + protocol: !Protocols + http: !HttpParameter + in: query + - !Parameter &ref_84 + schema: *ref_79 + implementation: Method + language: !Languages + default: + name: top + description: '' + serializedName: $top + protocol: !Protocols + http: !HttpParameter + in: query + - !Parameter &ref_85 + schema: *ref_14 + implementation: Method + language: !Languages + default: + name: orderby + description: '' + serializedName: $orderby + protocol: !Protocols + http: !HttpParameter + in: query + - *ref_17 + - *ref_18 + requests: + - !Request + parameters: + - !Parameter + schema: *ref_20 + implementation: Method + origin: modelerfour:synthesized/accept + required: true + language: !Languages + default: + name: accept + description: Accept header + serializedName: Accept + protocol: !Protocols + http: !HttpParameter + in: header + signatureParameters: [] + language: !Languages + default: + name: '' + description: '' + protocol: !Protocols + http: !HttpRequest + path: /subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions + method: get + uri: '{$host}' + signatureParameters: + - *ref_80 + - *ref_81 + - *ref_82 + - *ref_83 + - *ref_84 + - *ref_85 + responses: + - !SchemaResponse + schema: *ref_86 + language: !Languages + default: + name: '' + description: OK + protocol: !Protocols + http: !HttpResponse + knownMediaType: json + mediaTypes: + - application/json + statusCodes: + - '200' + extensions: + x-ms-odata: '#/components/schemas/VirtualMachineExtensionImage' + language: !Languages + default: + name: ListVersions + description: Gets a list of virtual machine extension image versions. + protocol: !Protocols {} + language: !Languages + default: + name: VirtualMachineExtensionImages + description: '' + protocol: !Protocols {} +security: !Security + authenticationRequired: true +language: !Languages + default: + name: ComputeManagementClient + description: '' +protocol: !Protocols + http: !HttpModel {} diff --git a/test/TestProjects/MgmtParent/Generated/Configuration.json b/test/TestProjects/MgmtParent/Generated/Configuration.json new file mode 100644 index 00000000000..a6f854d138f --- /dev/null +++ b/test/TestProjects/MgmtParent/Generated/Configuration.json @@ -0,0 +1 @@ +{"OutputFolder":".","Namespace":"MgmtParent","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":true,"PublicClients":true,"ModelNamespace":false,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{"VirtualMachineExtensionImages":"Microsoft.Compute/locations/publishers/vmextension"},"OperationGroupToResource":{"VirtualMachineExtensionImages":"VirtualMachineExtensionImage"},"ResourceRename":{},"OperationGroupToParent":{"VirtualMachineExtensionImages":"Microsoft.Compute/locations/publishers"}} \ No newline at end of file diff --git a/test/TestProjects/MgmtParent/Generated/DedicatedHost.cs b/test/TestProjects/MgmtParent/Generated/DedicatedHost.cs new file mode 100644 index 00000000000..b9604ae208e --- /dev/null +++ b/test/TestProjects/MgmtParent/Generated/DedicatedHost.cs @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace MgmtParent +{ + /// A Class representing a DedicatedHost along with the instance operations that can be performed on it. + public class DedicatedHost : DedicatedHostOperations + { + } +} diff --git a/test/TestProjects/MgmtParent/Generated/DedicatedHostContainer.cs b/test/TestProjects/MgmtParent/Generated/DedicatedHostContainer.cs new file mode 100644 index 00000000000..2d6898e9995 --- /dev/null +++ b/test/TestProjects/MgmtParent/Generated/DedicatedHostContainer.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace MgmtParent +{ + /// A class representing collection of DedicatedHost and their operations over a [ParentResource]. + public partial class DedicatedHostContainer + { + /// Initializes a new instance of DedicatedHostContainer for mocking. + protected DedicatedHostContainer() + { + } + } +} diff --git a/test/TestProjects/MgmtParent/Generated/DedicatedHostGroup.cs b/test/TestProjects/MgmtParent/Generated/DedicatedHostGroup.cs new file mode 100644 index 00000000000..f099f8a3a56 --- /dev/null +++ b/test/TestProjects/MgmtParent/Generated/DedicatedHostGroup.cs @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace MgmtParent +{ + /// A Class representing a DedicatedHostGroup along with the instance operations that can be performed on it. + public class DedicatedHostGroup : DedicatedHostGroupOperations + { + } +} diff --git a/test/TestProjects/MgmtParent/Generated/DedicatedHostGroupContainer.cs b/test/TestProjects/MgmtParent/Generated/DedicatedHostGroupContainer.cs new file mode 100644 index 00000000000..6b13465cc46 --- /dev/null +++ b/test/TestProjects/MgmtParent/Generated/DedicatedHostGroupContainer.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace MgmtParent +{ + /// A class representing collection of DedicatedHostGroup and their operations over a [ParentResource]. + public partial class DedicatedHostGroupContainer + { + /// Initializes a new instance of DedicatedHostGroupContainer for mocking. + protected DedicatedHostGroupContainer() + { + } + } +} diff --git a/test/TestProjects/MgmtParent/Generated/DedicatedHostGroupOperations.cs b/test/TestProjects/MgmtParent/Generated/DedicatedHostGroupOperations.cs new file mode 100644 index 00000000000..861782ea7e2 --- /dev/null +++ b/test/TestProjects/MgmtParent/Generated/DedicatedHostGroupOperations.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace MgmtParent +{ + /// A class representing the operations that can be performed over a specific DedicatedHostGroup. + public partial class DedicatedHostGroupOperations + { + /// Initializes a new instance of DedicatedHostGroupOperations for mocking. + protected DedicatedHostGroupOperations() + { + } + } +} diff --git a/test/TestProjects/MgmtParent/Generated/DedicatedHostGroupsRestOperations.cs b/test/TestProjects/MgmtParent/Generated/DedicatedHostGroupsRestOperations.cs new file mode 100644 index 00000000000..ea71f23c290 --- /dev/null +++ b/test/TestProjects/MgmtParent/Generated/DedicatedHostGroupsRestOperations.cs @@ -0,0 +1,305 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace MgmtParent +{ + internal partial class DedicatedHostGroupsRestOperations + { + private string subscriptionId; + private Uri endpoint; + private string apiVersion; + private ClientDiagnostics _clientDiagnostics; + private HttpPipeline _pipeline; + + /// Initializes a new instance of DedicatedHostGroupsRestOperations. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// server parameter. + /// Api Version. + /// or is null. + public DedicatedHostGroupsRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-06-01") + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } + + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = apiVersion; + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string hostGroupName, string foo) + { + 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.Compute/hostGroups/", false); + uri.AppendPath(hostGroupName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var model = new DedicatedHostGroupData() + { + Foo = foo + }; + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(model); + request.Content = content; + return message; + } + + /// Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596). + /// The name of the resource group. + /// The name of the dedicated host group. + /// specifies the foo. + /// The cancellation token to use. + /// or is null. + public async Task> CreateOrUpdateAsync(string resourceGroupName, string hostGroupName, string foo = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (hostGroupName == null) + { + throw new ArgumentNullException(nameof(hostGroupName)); + } + + using var message = CreateCreateOrUpdateRequest(resourceGroupName, hostGroupName, foo); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + DedicatedHostGroupData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DedicatedHostGroupData.DeserializeDedicatedHostGroupData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596). + /// The name of the resource group. + /// The name of the dedicated host group. + /// specifies the foo. + /// The cancellation token to use. + /// or is null. + public Response CreateOrUpdate(string resourceGroupName, string hostGroupName, string foo = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (hostGroupName == null) + { + throw new ArgumentNullException(nameof(hostGroupName)); + } + + using var message = CreateCreateOrUpdateRequest(resourceGroupName, hostGroupName, foo); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + DedicatedHostGroupData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DedicatedHostGroupData.DeserializeDedicatedHostGroupData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteRequest(string resourceGroupName, string hostGroupName) + { + 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.Compute/hostGroups/", false); + uri.AppendPath(hostGroupName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + return message; + } + + /// Delete a dedicated host group. + /// The name of the resource group. + /// The name of the dedicated host group. + /// The cancellation token to use. + /// or is null. + public async Task DeleteAsync(string resourceGroupName, string hostGroupName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (hostGroupName == null) + { + throw new ArgumentNullException(nameof(hostGroupName)); + } + + using var message = CreateDeleteRequest(resourceGroupName, hostGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Delete a dedicated host group. + /// The name of the resource group. + /// The name of the dedicated host group. + /// The cancellation token to use. + /// or is null. + public Response Delete(string resourceGroupName, string hostGroupName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (hostGroupName == null) + { + throw new ArgumentNullException(nameof(hostGroupName)); + } + + using var message = CreateDeleteRequest(resourceGroupName, hostGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetRequest(string resourceGroupName, string hostGroupName) + { + 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.Compute/hostGroups/", false); + uri.AppendPath(hostGroupName, true); + uri.AppendQuery("$expand", "instanceView", true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Retrieves information about a dedicated host group. + /// The name of the resource group. + /// The name of the dedicated host group. + /// The cancellation token to use. + /// or is null. + public async Task> GetAsync(string resourceGroupName, string hostGroupName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (hostGroupName == null) + { + throw new ArgumentNullException(nameof(hostGroupName)); + } + + using var message = CreateGetRequest(resourceGroupName, hostGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DedicatedHostGroupData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DedicatedHostGroupData.DeserializeDedicatedHostGroupData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Retrieves information about a dedicated host group. + /// The name of the resource group. + /// The name of the dedicated host group. + /// The cancellation token to use. + /// or is null. + public Response Get(string resourceGroupName, string hostGroupName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (hostGroupName == null) + { + throw new ArgumentNullException(nameof(hostGroupName)); + } + + using var message = CreateGetRequest(resourceGroupName, hostGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DedicatedHostGroupData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DedicatedHostGroupData.DeserializeDedicatedHostGroupData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + } +} diff --git a/test/TestProjects/MgmtParent/Generated/DedicatedHostOperations.cs b/test/TestProjects/MgmtParent/Generated/DedicatedHostOperations.cs new file mode 100644 index 00000000000..0498ee4737c --- /dev/null +++ b/test/TestProjects/MgmtParent/Generated/DedicatedHostOperations.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace MgmtParent +{ + /// A class representing the operations that can be performed over a specific DedicatedHost. + public partial class DedicatedHostOperations + { + /// Initializes a new instance of DedicatedHostOperations for mocking. + protected DedicatedHostOperations() + { + } + } +} diff --git a/test/TestProjects/MgmtParent/Generated/DedicatedHostsRestOperations.cs b/test/TestProjects/MgmtParent/Generated/DedicatedHostsRestOperations.cs new file mode 100644 index 00000000000..c035cd2044a --- /dev/null +++ b/test/TestProjects/MgmtParent/Generated/DedicatedHostsRestOperations.cs @@ -0,0 +1,599 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace MgmtParent +{ + internal partial class DedicatedHostsRestOperations + { + private string subscriptionId; + private Uri endpoint; + private string apiVersion; + private ClientDiagnostics _clientDiagnostics; + private HttpPipeline _pipeline; + + /// Initializes a new instance of DedicatedHostsRestOperations. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// server parameter. + /// Api Version. + /// or is null. + public DedicatedHostsRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-06-01") + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } + + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = apiVersion; + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string resourceGroupName, string hostGroupName, string hostName, string foo) + { + 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.Compute/hostGroups/", false); + uri.AppendPath(hostGroupName, true); + uri.AppendPath("/hosts/", false); + uri.AppendPath(hostName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var model = new DedicatedHostData() + { + Foo = foo + }; + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(model); + request.Content = content; + return message; + } + + /// Create or update a dedicated host . + /// The name of the resource group. + /// The name of the dedicated host group. + /// The name of the dedicated host . + /// specifies the foo. + /// The cancellation token to use. + /// , , or is null. + public async Task CreateOrUpdateAsync(string resourceGroupName, string hostGroupName, string hostName, string foo = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (hostGroupName == null) + { + throw new ArgumentNullException(nameof(hostGroupName)); + } + if (hostName == null) + { + throw new ArgumentNullException(nameof(hostName)); + } + + using var message = CreateCreateOrUpdateRequest(resourceGroupName, hostGroupName, hostName, foo); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Create or update a dedicated host . + /// The name of the resource group. + /// The name of the dedicated host group. + /// The name of the dedicated host . + /// specifies the foo. + /// The cancellation token to use. + /// , , or is null. + public Response CreateOrUpdate(string resourceGroupName, string hostGroupName, string hostName, string foo = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (hostGroupName == null) + { + throw new ArgumentNullException(nameof(hostGroupName)); + } + if (hostName == null) + { + throw new ArgumentNullException(nameof(hostName)); + } + + using var message = CreateCreateOrUpdateRequest(resourceGroupName, hostGroupName, hostName, foo); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateRequest(string resourceGroupName, string hostGroupName, string hostName, string updator) + { + 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.Compute/hostGroups/", false); + uri.AppendPath(hostGroupName, true); + uri.AppendPath("/hosts/", false); + uri.AppendPath(hostName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var model = new DedicatedHostUpdate() + { + Updator = updator + }; + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(model); + request.Content = content; + return message; + } + + /// Update an dedicated host . + /// The name of the resource group. + /// The name of the dedicated host group. + /// The name of the dedicated host . + /// specifies the updator. + /// The cancellation token to use. + /// , , or is null. + public async Task UpdateAsync(string resourceGroupName, string hostGroupName, string hostName, string updator = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (hostGroupName == null) + { + throw new ArgumentNullException(nameof(hostGroupName)); + } + if (hostName == null) + { + throw new ArgumentNullException(nameof(hostName)); + } + + using var message = CreateUpdateRequest(resourceGroupName, hostGroupName, hostName, updator); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Update an dedicated host . + /// The name of the resource group. + /// The name of the dedicated host group. + /// The name of the dedicated host . + /// specifies the updator. + /// The cancellation token to use. + /// , , or is null. + public Response Update(string resourceGroupName, string hostGroupName, string hostName, string updator = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (hostGroupName == null) + { + throw new ArgumentNullException(nameof(hostGroupName)); + } + if (hostName == null) + { + throw new ArgumentNullException(nameof(hostName)); + } + + using var message = CreateUpdateRequest(resourceGroupName, hostGroupName, hostName, updator); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteRequest(string resourceGroupName, string hostGroupName, string hostName) + { + 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.Compute/hostGroups/", false); + uri.AppendPath(hostGroupName, true); + uri.AppendPath("/hosts/", false); + uri.AppendPath(hostName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + return message; + } + + /// Delete a dedicated host. + /// The name of the resource group. + /// The name of the dedicated host group. + /// The name of the dedicated host. + /// The cancellation token to use. + /// , , or is null. + public async Task DeleteAsync(string resourceGroupName, string hostGroupName, string hostName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (hostGroupName == null) + { + throw new ArgumentNullException(nameof(hostGroupName)); + } + if (hostName == null) + { + throw new ArgumentNullException(nameof(hostName)); + } + + using var message = CreateDeleteRequest(resourceGroupName, hostGroupName, hostName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Delete a dedicated host. + /// The name of the resource group. + /// The name of the dedicated host group. + /// The name of the dedicated host. + /// The cancellation token to use. + /// , , or is null. + public Response Delete(string resourceGroupName, string hostGroupName, string hostName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (hostGroupName == null) + { + throw new ArgumentNullException(nameof(hostGroupName)); + } + if (hostName == null) + { + throw new ArgumentNullException(nameof(hostName)); + } + + using var message = CreateDeleteRequest(resourceGroupName, hostGroupName, hostName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetRequest(string resourceGroupName, string hostGroupName, string hostName) + { + 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.Compute/hostGroups/", false); + uri.AppendPath(hostGroupName, true); + uri.AppendPath("/hosts/", false); + uri.AppendPath(hostName, true); + uri.AppendQuery("$expand", "instanceView", true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Retrieves information about a dedicated host. + /// The name of the resource group. + /// The name of the dedicated host group. + /// The name of the dedicated host. + /// The cancellation token to use. + /// , , or is null. + public async Task> GetAsync(string resourceGroupName, string hostGroupName, string hostName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (hostGroupName == null) + { + throw new ArgumentNullException(nameof(hostGroupName)); + } + if (hostName == null) + { + throw new ArgumentNullException(nameof(hostName)); + } + + using var message = CreateGetRequest(resourceGroupName, hostGroupName, hostName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DedicatedHostData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DedicatedHostData.DeserializeDedicatedHostData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Retrieves information about a dedicated host. + /// The name of the resource group. + /// The name of the dedicated host group. + /// The name of the dedicated host. + /// The cancellation token to use. + /// , , or is null. + public Response Get(string resourceGroupName, string hostGroupName, string hostName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (hostGroupName == null) + { + throw new ArgumentNullException(nameof(hostGroupName)); + } + if (hostName == null) + { + throw new ArgumentNullException(nameof(hostName)); + } + + using var message = CreateGetRequest(resourceGroupName, hostGroupName, hostName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DedicatedHostData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DedicatedHostData.DeserializeDedicatedHostData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByHostGroupRequest(string resourceGroupName, string hostGroupName) + { + 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.Compute/hostGroups/", false); + uri.AppendPath(hostGroupName, true); + uri.AppendPath("/hosts", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. + /// The name of the resource group. + /// The name of the dedicated host group. + /// The cancellation token to use. + /// or is null. + public async Task> ListByHostGroupAsync(string resourceGroupName, string hostGroupName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (hostGroupName == null) + { + throw new ArgumentNullException(nameof(hostGroupName)); + } + + using var message = CreateListByHostGroupRequest(resourceGroupName, hostGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DedicatedHostListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DedicatedHostListResult.DeserializeDedicatedHostListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. + /// The name of the resource group. + /// The name of the dedicated host group. + /// The cancellation token to use. + /// or is null. + public Response ListByHostGroup(string resourceGroupName, string hostGroupName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (hostGroupName == null) + { + throw new ArgumentNullException(nameof(hostGroupName)); + } + + using var message = CreateListByHostGroupRequest(resourceGroupName, hostGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DedicatedHostListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DedicatedHostListResult.DeserializeDedicatedHostListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByHostGroupNextPageRequest(string nextLink, string resourceGroupName, string hostGroupName) + { + 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"); + return message; + } + + /// Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. + /// The URL to the next page of results. + /// The name of the resource group. + /// The name of the dedicated host group. + /// The cancellation token to use. + /// , , or is null. + public async Task> ListByHostGroupNextPageAsync(string nextLink, string resourceGroupName, string hostGroupName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (hostGroupName == null) + { + throw new ArgumentNullException(nameof(hostGroupName)); + } + + using var message = CreateListByHostGroupNextPageRequest(nextLink, resourceGroupName, hostGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DedicatedHostListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = DedicatedHostListResult.DeserializeDedicatedHostListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts. + /// The URL to the next page of results. + /// The name of the resource group. + /// The name of the dedicated host group. + /// The cancellation token to use. + /// , , or is null. + public Response ListByHostGroupNextPage(string nextLink, string resourceGroupName, string hostGroupName, CancellationToken cancellationToken = default) + { + if (nextLink == null) + { + throw new ArgumentNullException(nameof(nextLink)); + } + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (hostGroupName == null) + { + throw new ArgumentNullException(nameof(hostGroupName)); + } + + using var message = CreateListByHostGroupNextPageRequest(nextLink, resourceGroupName, hostGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DedicatedHostListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = DedicatedHostListResult.DeserializeDedicatedHostListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + } +} diff --git a/test/TestProjects/MgmtParent/Generated/Models/AvailabilitySetData.Serialization.cs b/test/TestProjects/MgmtParent/Generated/Models/AvailabilitySetData.Serialization.cs new file mode 100644 index 00000000000..ed18b6bf380 --- /dev/null +++ b/test/TestProjects/MgmtParent/Generated/Models/AvailabilitySetData.Serialization.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace MgmtParent +{ + public partial class AvailabilitySetData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Bar)) + { + writer.WritePropertyName("bar"); + writer.WriteStringValue(Bar); + } + writer.WriteEndObject(); + } + + internal static AvailabilitySetData DeserializeAvailabilitySetData(JsonElement element) + { + Optional bar = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("bar")) + { + bar = property.Value.GetString(); + continue; + } + } + return new AvailabilitySetData(bar.Value); + } + } +} diff --git a/test/TestProjects/MgmtParent/Generated/Models/AvailabilitySetData.cs b/test/TestProjects/MgmtParent/Generated/Models/AvailabilitySetData.cs new file mode 100644 index 00000000000..525cf5fc976 --- /dev/null +++ b/test/TestProjects/MgmtParent/Generated/Models/AvailabilitySetData.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace MgmtParent +{ + /// A class representing the AvailabilitySet data model. + public partial class AvailabilitySetData + { + /// Initializes a new instance of AvailabilitySetData. + public AvailabilitySetData() + { + } + + /// Initializes a new instance of AvailabilitySetData. + /// specifies the bar. + internal AvailabilitySetData(string bar) + { + Bar = bar; + } + + /// specifies the bar. + public string Bar { get; set; } + } +} diff --git a/test/TestProjects/MgmtParent/Generated/Models/AvailabilitySetListResult.Serialization.cs b/test/TestProjects/MgmtParent/Generated/Models/AvailabilitySetListResult.Serialization.cs new file mode 100644 index 00000000000..d0db5e400e3 --- /dev/null +++ b/test/TestProjects/MgmtParent/Generated/Models/AvailabilitySetListResult.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace MgmtParent +{ + internal partial class AvailabilitySetListResult + { + internal static AvailabilitySetListResult DeserializeAvailabilitySetListResult(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AvailabilitySetData.DeserializeAvailabilitySetData(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new AvailabilitySetListResult(value, nextLink.Value); + } + } +} diff --git a/test/TestProjects/MgmtParent/Generated/Models/AvailabilitySetListResult.cs b/test/TestProjects/MgmtParent/Generated/Models/AvailabilitySetListResult.cs new file mode 100644 index 00000000000..10783f6f26e --- /dev/null +++ b/test/TestProjects/MgmtParent/Generated/Models/AvailabilitySetListResult.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; +using System.Linq; + +namespace MgmtParent +{ + /// The List Availability Set operation response. + internal partial class AvailabilitySetListResult + { + /// Initializes a new instance of AvailabilitySetListResult. + /// The list of availability sets. + /// is null. + internal AvailabilitySetListResult(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of AvailabilitySetListResult. + /// The list of availability sets. + /// The URI to fetch the next page of AvailabilitySets. Call ListNext() with this URI to fetch the next page of AvailabilitySets. + internal AvailabilitySetListResult(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// The list of availability sets. + public IReadOnlyList Value { get; } + /// The URI to fetch the next page of AvailabilitySets. Call ListNext() with this URI to fetch the next page of AvailabilitySets. + public string NextLink { get; } + } +} diff --git a/test/TestProjects/MgmtParent/Generated/Models/AvailabilitySetUpdate.Serialization.cs b/test/TestProjects/MgmtParent/Generated/Models/AvailabilitySetUpdate.Serialization.cs new file mode 100644 index 00000000000..7895d141b61 --- /dev/null +++ b/test/TestProjects/MgmtParent/Generated/Models/AvailabilitySetUpdate.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace MgmtParent +{ + internal partial class AvailabilitySetUpdate : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Updator)) + { + writer.WritePropertyName("updator"); + writer.WriteStringValue(Updator); + } + writer.WriteEndObject(); + } + } +} diff --git a/test/TestProjects/MgmtParent/Generated/Models/AvailabilitySetUpdate.cs b/test/TestProjects/MgmtParent/Generated/Models/AvailabilitySetUpdate.cs new file mode 100644 index 00000000000..a0a08a12e71 --- /dev/null +++ b/test/TestProjects/MgmtParent/Generated/Models/AvailabilitySetUpdate.cs @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace MgmtParent +{ + /// Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Manage the availability of virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). <br><br> For more information on Azure planned maintenance, see [Planned maintenance for virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) <br><br> Currently, a VM can only be added to availability set at creation time. An existing VM cannot be added to an availability set. + internal partial class AvailabilitySetUpdate + { + /// Initializes a new instance of AvailabilitySetUpdate. + public AvailabilitySetUpdate() + { + } + + /// specifies the updator. + public string Updator { get; set; } + } +} diff --git a/test/TestProjects/MgmtParent/Generated/Models/DedicatedHostData.Serialization.cs b/test/TestProjects/MgmtParent/Generated/Models/DedicatedHostData.Serialization.cs new file mode 100644 index 00000000000..dd902070e09 --- /dev/null +++ b/test/TestProjects/MgmtParent/Generated/Models/DedicatedHostData.Serialization.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace MgmtParent +{ + public partial class DedicatedHostData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Foo)) + { + writer.WritePropertyName("foo"); + writer.WriteStringValue(Foo); + } + writer.WriteEndObject(); + } + + internal static DedicatedHostData DeserializeDedicatedHostData(JsonElement element) + { + Optional foo = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("foo")) + { + foo = property.Value.GetString(); + continue; + } + } + return new DedicatedHostData(foo.Value); + } + } +} diff --git a/test/TestProjects/MgmtParent/Generated/Models/DedicatedHostData.cs b/test/TestProjects/MgmtParent/Generated/Models/DedicatedHostData.cs new file mode 100644 index 00000000000..e0825679c08 --- /dev/null +++ b/test/TestProjects/MgmtParent/Generated/Models/DedicatedHostData.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace MgmtParent +{ + /// A class representing the DedicatedHost data model. + public partial class DedicatedHostData + { + /// Initializes a new instance of DedicatedHostData. + public DedicatedHostData() + { + } + + /// Initializes a new instance of DedicatedHostData. + /// specifies the foo. + internal DedicatedHostData(string foo) + { + Foo = foo; + } + + /// specifies the foo. + public string Foo { get; set; } + } +} diff --git a/test/TestProjects/MgmtParent/Generated/Models/DedicatedHostGroupData.Serialization.cs b/test/TestProjects/MgmtParent/Generated/Models/DedicatedHostGroupData.Serialization.cs new file mode 100644 index 00000000000..a2b0c9396f3 --- /dev/null +++ b/test/TestProjects/MgmtParent/Generated/Models/DedicatedHostGroupData.Serialization.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace MgmtParent +{ + public partial class DedicatedHostGroupData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Foo)) + { + writer.WritePropertyName("foo"); + writer.WriteStringValue(Foo); + } + writer.WriteEndObject(); + } + + internal static DedicatedHostGroupData DeserializeDedicatedHostGroupData(JsonElement element) + { + Optional foo = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("foo")) + { + foo = property.Value.GetString(); + continue; + } + } + return new DedicatedHostGroupData(foo.Value); + } + } +} diff --git a/test/TestProjects/MgmtParent/Generated/Models/DedicatedHostGroupData.cs b/test/TestProjects/MgmtParent/Generated/Models/DedicatedHostGroupData.cs new file mode 100644 index 00000000000..4d3c60d1002 --- /dev/null +++ b/test/TestProjects/MgmtParent/Generated/Models/DedicatedHostGroupData.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace MgmtParent +{ + /// A class representing the DedicatedHostGroup data model. + public partial class DedicatedHostGroupData + { + /// Initializes a new instance of DedicatedHostGroupData. + public DedicatedHostGroupData() + { + } + + /// Initializes a new instance of DedicatedHostGroupData. + /// specifies the foo. + internal DedicatedHostGroupData(string foo) + { + Foo = foo; + } + + /// specifies the foo. + public string Foo { get; set; } + } +} diff --git a/test/TestProjects/MgmtParent/Generated/Models/DedicatedHostListResult.Serialization.cs b/test/TestProjects/MgmtParent/Generated/Models/DedicatedHostListResult.Serialization.cs new file mode 100644 index 00000000000..55d7ad06501 --- /dev/null +++ b/test/TestProjects/MgmtParent/Generated/Models/DedicatedHostListResult.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace MgmtParent +{ + internal partial class DedicatedHostListResult + { + internal static DedicatedHostListResult DeserializeDedicatedHostListResult(JsonElement element) + { + IReadOnlyList value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value")) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DedicatedHostData.DeserializeDedicatedHostData(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink")) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new DedicatedHostListResult(value, nextLink.Value); + } + } +} diff --git a/test/TestProjects/MgmtParent/Generated/Models/DedicatedHostListResult.cs b/test/TestProjects/MgmtParent/Generated/Models/DedicatedHostListResult.cs new file mode 100644 index 00000000000..291552889a4 --- /dev/null +++ b/test/TestProjects/MgmtParent/Generated/Models/DedicatedHostListResult.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; +using System.Linq; + +namespace MgmtParent +{ + /// The list dedicated host operation response. + internal partial class DedicatedHostListResult + { + /// Initializes a new instance of DedicatedHostListResult. + /// The list of dedicated hosts. + /// is null. + internal DedicatedHostListResult(IEnumerable value) + { + if (value == null) + { + throw new ArgumentNullException(nameof(value)); + } + + Value = value.ToList(); + } + + /// Initializes a new instance of DedicatedHostListResult. + /// The list of dedicated hosts. + /// The URI to fetch the next page of dedicated hosts. Call ListNext() with this URI to fetch the next page of dedicated hosts. + internal DedicatedHostListResult(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// The list of dedicated hosts. + public IReadOnlyList Value { get; } + /// The URI to fetch the next page of dedicated hosts. Call ListNext() with this URI to fetch the next page of dedicated hosts. + public string NextLink { get; } + } +} diff --git a/test/TestProjects/MgmtParent/Generated/Models/DedicatedHostUpdate.Serialization.cs b/test/TestProjects/MgmtParent/Generated/Models/DedicatedHostUpdate.Serialization.cs new file mode 100644 index 00000000000..9c1294f22f7 --- /dev/null +++ b/test/TestProjects/MgmtParent/Generated/Models/DedicatedHostUpdate.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace MgmtParent +{ + internal partial class DedicatedHostUpdate : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Updator)) + { + writer.WritePropertyName("updator"); + writer.WriteStringValue(Updator); + } + writer.WriteEndObject(); + } + } +} diff --git a/test/TestProjects/MgmtParent/Generated/Models/DedicatedHostUpdate.cs b/test/TestProjects/MgmtParent/Generated/Models/DedicatedHostUpdate.cs new file mode 100644 index 00000000000..f603bfe571f --- /dev/null +++ b/test/TestProjects/MgmtParent/Generated/Models/DedicatedHostUpdate.cs @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace MgmtParent +{ + /// Specifies information about the Dedicated host. + internal partial class DedicatedHostUpdate + { + /// Initializes a new instance of DedicatedHostUpdate. + public DedicatedHostUpdate() + { + } + + /// specifies the updator. + public string Updator { get; set; } + } +} diff --git a/test/TestProjects/MgmtParent/Generated/Models/VirtualMachineExtensionImageData.Serialization.cs b/test/TestProjects/MgmtParent/Generated/Models/VirtualMachineExtensionImageData.Serialization.cs new file mode 100644 index 00000000000..39d60e6d97c --- /dev/null +++ b/test/TestProjects/MgmtParent/Generated/Models/VirtualMachineExtensionImageData.Serialization.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace MgmtParent +{ + public partial class VirtualMachineExtensionImageData + { + internal static VirtualMachineExtensionImageData DeserializeVirtualMachineExtensionImageData(JsonElement element) + { + Optional bar = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("bar")) + { + bar = property.Value.GetString(); + continue; + } + } + return new VirtualMachineExtensionImageData(bar.Value); + } + } +} diff --git a/test/TestProjects/MgmtParent/Generated/Models/VirtualMachineExtensionImageData.cs b/test/TestProjects/MgmtParent/Generated/Models/VirtualMachineExtensionImageData.cs new file mode 100644 index 00000000000..8682108670f --- /dev/null +++ b/test/TestProjects/MgmtParent/Generated/Models/VirtualMachineExtensionImageData.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace MgmtParent +{ + /// A class representing the VirtualMachineExtensionImage data model. + public partial class VirtualMachineExtensionImageData + { + /// Initializes a new instance of VirtualMachineExtensionImageData. + internal VirtualMachineExtensionImageData() + { + } + + /// Initializes a new instance of VirtualMachineExtensionImageData. + /// specifies the bar. + internal VirtualMachineExtensionImageData(string bar) + { + Bar = bar; + } + + /// specifies the bar. + public string Bar { get; } + } +} diff --git a/test/TestProjects/MgmtParent/Generated/VirtualMachineExtensionImage.cs b/test/TestProjects/MgmtParent/Generated/VirtualMachineExtensionImage.cs new file mode 100644 index 00000000000..f652189d20c --- /dev/null +++ b/test/TestProjects/MgmtParent/Generated/VirtualMachineExtensionImage.cs @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace MgmtParent +{ + /// A Class representing a VirtualMachineExtensionImage along with the instance operations that can be performed on it. + public class VirtualMachineExtensionImage : VirtualMachineExtensionImageOperations + { + } +} diff --git a/test/TestProjects/MgmtParent/Generated/VirtualMachineExtensionImageContainer.cs b/test/TestProjects/MgmtParent/Generated/VirtualMachineExtensionImageContainer.cs new file mode 100644 index 00000000000..d039dd6fdc9 --- /dev/null +++ b/test/TestProjects/MgmtParent/Generated/VirtualMachineExtensionImageContainer.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace MgmtParent +{ + /// A class representing collection of VirtualMachineExtensionImage and their operations over a [ParentResource]. + public partial class VirtualMachineExtensionImageContainer + { + /// Initializes a new instance of VirtualMachineExtensionImageContainer for mocking. + protected VirtualMachineExtensionImageContainer() + { + } + } +} diff --git a/test/TestProjects/MgmtParent/Generated/VirtualMachineExtensionImageOperations.cs b/test/TestProjects/MgmtParent/Generated/VirtualMachineExtensionImageOperations.cs new file mode 100644 index 00000000000..970de890f09 --- /dev/null +++ b/test/TestProjects/MgmtParent/Generated/VirtualMachineExtensionImageOperations.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace MgmtParent +{ + /// A class representing the operations that can be performed over a specific VirtualMachineExtensionImage. + public partial class VirtualMachineExtensionImageOperations + { + /// Initializes a new instance of VirtualMachineExtensionImageOperations for mocking. + protected VirtualMachineExtensionImageOperations() + { + } + } +} diff --git a/test/TestProjects/MgmtParent/Generated/VirtualMachineExtensionImagesRestOperations.cs b/test/TestProjects/MgmtParent/Generated/VirtualMachineExtensionImagesRestOperations.cs new file mode 100644 index 00000000000..60fc8cd6f09 --- /dev/null +++ b/test/TestProjects/MgmtParent/Generated/VirtualMachineExtensionImagesRestOperations.cs @@ -0,0 +1,378 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace MgmtParent +{ + internal partial class VirtualMachineExtensionImagesRestOperations + { + private string subscriptionId; + private Uri endpoint; + private string apiVersion; + private ClientDiagnostics _clientDiagnostics; + private HttpPipeline _pipeline; + + /// Initializes a new instance of VirtualMachineExtensionImagesRestOperations. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// server parameter. + /// Api Version. + /// or is null. + public VirtualMachineExtensionImagesRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-06-01") + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } + + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = apiVersion; + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + internal HttpMessage CreateGetRequest(string location, string publisherName, string type, string version) + { + 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.Compute/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/publishers/", false); + uri.AppendPath(publisherName, true); + uri.AppendPath("/artifacttypes/vmextension/types/", false); + uri.AppendPath(type, true); + uri.AppendPath("/versions/", false); + uri.AppendPath(version, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Gets a virtual machine extension image. + /// The name of a supported Azure region. + /// The String to use. + /// The String to use. + /// The String to use. + /// The cancellation token to use. + /// , , , or is null. + public async Task> GetAsync(string location, string publisherName, string type, string version, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + if (publisherName == null) + { + throw new ArgumentNullException(nameof(publisherName)); + } + if (type == null) + { + throw new ArgumentNullException(nameof(type)); + } + if (version == null) + { + throw new ArgumentNullException(nameof(version)); + } + + using var message = CreateGetRequest(location, publisherName, type, version); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VirtualMachineExtensionImageData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = VirtualMachineExtensionImageData.DeserializeVirtualMachineExtensionImageData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Gets a virtual machine extension image. + /// The name of a supported Azure region. + /// The String to use. + /// The String to use. + /// The String to use. + /// The cancellation token to use. + /// , , , or is null. + public Response Get(string location, string publisherName, string type, string version, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + if (publisherName == null) + { + throw new ArgumentNullException(nameof(publisherName)); + } + if (type == null) + { + throw new ArgumentNullException(nameof(type)); + } + if (version == null) + { + throw new ArgumentNullException(nameof(version)); + } + + using var message = CreateGetRequest(location, publisherName, type, version); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VirtualMachineExtensionImageData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = VirtualMachineExtensionImageData.DeserializeVirtualMachineExtensionImageData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListTypesRequest(string location, string publisherName) + { + 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.Compute/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/publishers/", false); + uri.AppendPath(publisherName, true); + uri.AppendPath("/artifacttypes/vmextension/types", false); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Gets a list of virtual machine extension image types. + /// The name of a supported Azure region. + /// The String to use. + /// The cancellation token to use. + /// or is null. + public async Task>> ListTypesAsync(string location, string publisherName, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + if (publisherName == null) + { + throw new ArgumentNullException(nameof(publisherName)); + } + + using var message = CreateListTypesRequest(location, publisherName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(VirtualMachineExtensionImageData.DeserializeVirtualMachineExtensionImageData(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Gets a list of virtual machine extension image types. + /// The name of a supported Azure region. + /// The String to use. + /// The cancellation token to use. + /// or is null. + public Response> ListTypes(string location, string publisherName, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + if (publisherName == null) + { + throw new ArgumentNullException(nameof(publisherName)); + } + + using var message = CreateListTypesRequest(location, publisherName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(VirtualMachineExtensionImageData.DeserializeVirtualMachineExtensionImageData(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListVersionsRequest(string location, string publisherName, string type, string filter, int? top, string orderby) + { + 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.Compute/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/publishers/", false); + uri.AppendPath(publisherName, true); + uri.AppendPath("/artifacttypes/vmextension/types/", false); + uri.AppendPath(type, true); + uri.AppendPath("/versions", false); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + if (orderby != null) + { + uri.AppendQuery("$orderby", orderby, true); + } + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Gets a list of virtual machine extension image versions. + /// The name of a supported Azure region. + /// The String to use. + /// The String to use. + /// The filter to apply on the operation. + /// The Integer to use. + /// The String to use. + /// The cancellation token to use. + /// , , or is null. + public async Task>> ListVersionsAsync(string location, string publisherName, string type, string filter = null, int? top = null, string orderby = null, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + if (publisherName == null) + { + throw new ArgumentNullException(nameof(publisherName)); + } + if (type == null) + { + throw new ArgumentNullException(nameof(type)); + } + + using var message = CreateListVersionsRequest(location, publisherName, type, filter, top, orderby); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(VirtualMachineExtensionImageData.DeserializeVirtualMachineExtensionImageData(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Gets a list of virtual machine extension image versions. + /// The name of a supported Azure region. + /// The String to use. + /// The String to use. + /// The filter to apply on the operation. + /// The Integer to use. + /// The String to use. + /// The cancellation token to use. + /// , , or is null. + public Response> ListVersions(string location, string publisherName, string type, string filter = null, int? top = null, string orderby = null, CancellationToken cancellationToken = default) + { + if (location == null) + { + throw new ArgumentNullException(nameof(location)); + } + if (publisherName == null) + { + throw new ArgumentNullException(nameof(publisherName)); + } + if (type == null) + { + throw new ArgumentNullException(nameof(type)); + } + + using var message = CreateListVersionsRequest(location, publisherName, type, filter, top, orderby); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + IReadOnlyList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(VirtualMachineExtensionImageData.DeserializeVirtualMachineExtensionImageData(item)); + } + value = array; + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + } +} diff --git a/test/TestProjects/MgmtParent/MgmtParent.csproj b/test/TestProjects/MgmtParent/MgmtParent.csproj new file mode 100644 index 00000000000..b56d216f16c --- /dev/null +++ b/test/TestProjects/MgmtParent/MgmtParent.csproj @@ -0,0 +1,17 @@ + + + + netstandard2.0 + true + annotations + + + + + + + + + + + diff --git a/test/TestProjects/MgmtParent/mgmtParent.json b/test/TestProjects/MgmtParent/mgmtParent.json new file mode 100644 index 00000000000..e4dce3ccad3 --- /dev/null +++ b/test/TestProjects/MgmtParent/mgmtParent.json @@ -0,0 +1,981 @@ +{ + "swagger": "2.0", + "info": { + "title": "ComputeManagementClient", + "description": "The Compute Management Client.", + "version": "2020-06-01" + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "paths": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}": { + "put": { + "tags": [ + "AvailabilitySets" + ], + "operationId": "AvailabilitySets_CreateOrUpdate", + "description": "Create or update an availability set.", + "parameters": [ + { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group." + }, + { + "name": "availabilitySetName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the availability set." + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AvailabilitySet" + }, + "description": "Parameters supplied to the Create Availability Set operation." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/AvailabilitySet" + } + } + }, + "x-ms-examples": { + "Create an availability set.": { + "$ref": "./examples/CreateAnAvailabilitySet.json" + } + } + }, + "patch": { + "tags": [ + "AvailabilitySets" + ], + "operationId": "AvailabilitySets_Update", + "description": "Update an availability set.", + "parameters": [ + { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group." + }, + { + "name": "availabilitySetName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the availability set." + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AvailabilitySetUpdate" + }, + "description": "Parameters supplied to the Update Availability Set operation." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/AvailabilitySet" + } + } + } + }, + "delete": { + "tags": [ + "AvailabilitySets" + ], + "operationId": "AvailabilitySets_Delete", + "description": "Delete an availability set.", + "parameters": [ + { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group." + }, + { + "name": "availabilitySetName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the availability set." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "OK" + }, + "204": { + "description": "No Content" + } + } + }, + "get": { + "tags": [ + "AvailabilitySets" + ], + "operationId": "AvailabilitySets_Get", + "description": "Retrieves information about an availability set.", + "parameters": [ + { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group." + }, + { + "name": "availabilitySetName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the availability set." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/AvailabilitySet" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/availabilitySets": { + "get": { + "tags": [ + "AvailabilitySets" + ], + "operationId": "AvailabilitySets_ListBySubscription", + "description": "Lists all availability sets in a subscription.", + "parameters": [ + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "name": "$expand", + "in": "query", + "required": false, + "type": "string", + "description": "The expand expression to apply to the operation. Allowed values are 'instanceView'." + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/AvailabilitySetListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "List availability sets in a subscription.": { + "$ref": "./examples/ListAvailabilitySetsInASubscription.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets": { + "get": { + "tags": [ + "AvailabilitySets" + ], + "operationId": "AvailabilitySets_List", + "description": "Lists all availability sets in a resource group.", + "parameters": [ + { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/AvailabilitySetListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}": { + "put": { + "tags": [ + "DedicatedHostGroups" + ], + "operationId": "DedicatedHostGroups_CreateOrUpdate", + "description": "Create or update a dedicated host group. For details of Dedicated Host and Dedicated Host Groups please see [Dedicated Host Documentation] (https://go.microsoft.com/fwlink/?linkid=2082596)", + "parameters": [ + { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group." + }, + { + "name": "hostGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the dedicated host group." + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DedicatedHostGroup" + }, + "description": "Parameters supplied to the Create Dedicated Host Group." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/DedicatedHostGroup" + } + }, + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/DedicatedHostGroup" + } + } + }, + "x-ms-examples": { + "Create or update a dedicated host group.": { + "$ref": "./examples/CreateOrUpdateADedicatedHostGroup.json" + } + } + }, + "delete": { + "tags": [ + "DedicatedHostGroups" + ], + "operationId": "DedicatedHostGroups_Delete", + "description": "Delete a dedicated host group.", + "parameters": [ + { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group." + }, + { + "name": "hostGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the dedicated host group." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "OK" + }, + "204": { + "description": "No Content" + } + } + }, + "get": { + "tags": [ + "DedicatedHostGroups" + ], + "operationId": "DedicatedHostGroups_Get", + "description": "Retrieves information about a dedicated host group.", + "parameters": [ + { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group." + }, + { + "name": "hostGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the dedicated host group." + }, + { + "name": "$expand", + "in": "query", + "required": false, + "type": "string", + "description": "The expand expression to apply on the operation. The response shows the list of instance view of the dedicated hosts under the dedicated host group.", + "enum": [ + "instanceView" + ], + "x-ms-enum": { + "name": "InstanceViewTypes", + "modelAsString": false + } + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/DedicatedHostGroup" + } + } + }, + "x-ms-examples": { + "Create a dedicated host group.": { + "$ref": "./examples/GetADedicatedHostGroup.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts/{hostName}": { + "put": { + "tags": [ + "DedicatedHosts" + ], + "operationId": "DedicatedHosts_CreateOrUpdate", + "description": "Create or update a dedicated host .", + "parameters": [ + { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group." + }, + { + "name": "hostGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the dedicated host group." + }, + { + "name": "hostName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the dedicated host ." + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DedicatedHost" + }, + "description": "Parameters supplied to the Create Dedicated Host." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/DedicatedHost" + } + }, + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/DedicatedHost" + } + } + }, + "x-ms-examples": { + "Create or update a dedicated host .": { + "$ref": "./examples/CreateOrUpdateADedicatedHost.json" + } + }, + "x-ms-long-running-operation": true + }, + "patch": { + "tags": [ + "DedicatedHosts" + ], + "operationId": "DedicatedHosts_Update", + "description": "Update an dedicated host .", + "parameters": [ + { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group." + }, + { + "name": "hostGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the dedicated host group." + }, + { + "name": "hostName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the dedicated host ." + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DedicatedHostUpdate" + }, + "description": "Parameters supplied to the Update Dedicated Host operation." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/DedicatedHost" + } + } + }, + "x-ms-long-running-operation": true + }, + "delete": { + "tags": [ + "DedicatedHosts" + ], + "operationId": "DedicatedHosts_Delete", + "description": "Delete a dedicated host.", + "parameters": [ + { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group." + }, + { + "name": "hostGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the dedicated host group." + }, + { + "name": "hostName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the dedicated host." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "OK" + }, + "202": { + "description": "Accepted" + }, + "204": { + "description": "No Content" + } + }, + "x-ms-long-running-operation": true + }, + "get": { + "tags": [ + "DedicatedHosts" + ], + "operationId": "DedicatedHosts_Get", + "description": "Retrieves information about a dedicated host.", + "parameters": [ + { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group." + }, + { + "name": "hostGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the dedicated host group." + }, + { + "name": "hostName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the dedicated host." + }, + { + "name": "$expand", + "in": "query", + "required": false, + "type": "string", + "description": "The expand expression to apply on the operation.", + "enum": [ + "instanceView" + ], + "x-ms-enum": { + "name": "InstanceViewTypes", + "modelAsString": false + } + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/DedicatedHost" + } + } + }, + "x-ms-examples": { + "Get a dedicated host.": { + "$ref": "./examples/GetADedicatedHost.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/hostGroups/{hostGroupName}/hosts": { + "get": { + "tags": [ + "DedicatedHost" + ], + "operationId": "DedicatedHosts_ListByHostGroup", + "description": "Lists all of the dedicated hosts in the specified dedicated host group. Use the nextLink property in the response to get the next page of dedicated hosts.", + "parameters": [ + { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group." + }, + { + "name": "hostGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the dedicated host group." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/DedicatedHostListResult" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}": { + "get": { + "tags": [ + "VirtualMachineExtensionImages" + ], + "operationId": "VirtualMachineExtensionImages_Get", + "description": "Gets a virtual machine extension image.", + "parameters": [ + { + "name": "location", + "in": "path", + "required": true, + "type": "string", + "description": "The name of a supported Azure region." + }, + { + "name": "publisherName", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "type", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "version", + "in": "path", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/VirtualMachineExtensionImage" + } + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types": { + "get": { + "tags": [ + "VirtualMachineExtensionImages" + ], + "operationId": "VirtualMachineExtensionImages_ListTypes", + "description": "Gets a list of virtual machine extension image types.", + "parameters": [ + { + "name": "location", + "in": "path", + "required": true, + "type": "string", + "description": "The name of a supported Azure region." + }, + { + "name": "publisherName", + "in": "path", + "required": true, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/VirtualMachineExtensionImage" + } + } + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions": { + "get": { + "tags": [ + "VirtualMachineExtensionImages" + ], + "operationId": "VirtualMachineExtensionImages_ListVersions", + "description": "Gets a list of virtual machine extension image versions.", + "parameters": [ + { + "name": "location", + "in": "path", + "required": true, + "type": "string", + "description": "The name of a supported Azure region." + }, + { + "name": "publisherName", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "type", + "in": "path", + "required": true, + "type": "string" + }, + { + "name": "$filter", + "in": "query", + "required": false, + "type": "string", + "description": "The filter to apply on the operation." + }, + { + "name": "$top", + "in": "query", + "required": false, + "type": "integer", + "format": "int32" + }, + { + "name": "$orderby", + "in": "query", + "required": false, + "type": "string" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/VirtualMachineExtensionImage" + } + } + } + }, + "x-ms-odata": "#/definitions/VirtualMachineExtensionImage" + } + } + }, + "definitions": { + "AvailabilitySet": { + "properties": { + "bar": { + "type": "string", + "description": "specifies the bar" + } + }, + "description": "Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Manage the availability of virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).

For more information on Azure planned maintenance, see [Planned maintenance for virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)

Currently, a VM can only be added to availability set at creation time. An existing VM cannot be added to an availability set." + }, + "AvailabilitySetUpdate": { + "properties": { + "updator": { + "type": "string", + "description": "specifies the updator" + } + }, + "description": "Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Manage the availability of virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).

For more information on Azure planned maintenance, see [Planned maintenance for virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)

Currently, a VM can only be added to availability set at creation time. An existing VM cannot be added to an availability set." + }, + "AvailabilitySetListResult": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/AvailabilitySet" + }, + "description": "The list of availability sets" + }, + "nextLink": { + "type": "string", + "description": "The URI to fetch the next page of AvailabilitySets. Call ListNext() with this URI to fetch the next page of AvailabilitySets." + } + }, + "required": [ + "value" + ], + "description": "The List Availability Set operation response." + }, + "VirtualMachineExtensionImage": { + "properties": { + "bar": { + "type": "string", + "description": "specifies the bar" + } + }, + "description": "The VirtualMachineExtensionImage." + }, + "DedicatedHost": { + "properties": { + "foo": { + "type": "string", + "description": "specifies the foo" + } + }, + "description": "Specifies information about the Dedicated host." + }, + "DedicatedHostGroup": { + "properties": { + "foo": { + "type": "string", + "description": "specifies the foo" + } + }, + "description": "Specifies information about the Dedicated host." + }, + "DedicatedHostUpdate": { + "properties": { + "updator": { + "type": "string", + "description": "specifies the updator" + } + }, + "description": "Specifies information about the Dedicated host." + }, + "DedicatedHostListResult": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/DedicatedHost" + }, + "description": "The list of dedicated hosts" + }, + "nextLink": { + "type": "string", + "description": "The URI to fetch the next page of dedicated hosts. Call ListNext() with this URI to fetch the next page of dedicated hosts." + } + }, + "required": [ + "value" + ], + "description": "The list dedicated host operation response." + } + }, + "parameters": { + "SubscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "required": true, + "type": "string", + "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call." + }, + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "Client Api Version." + } + } +} diff --git a/test/TestProjects/MgmtParent/readme.md b/test/TestProjects/MgmtParent/readme.md new file mode 100644 index 00000000000..8f9e16a64be --- /dev/null +++ b/test/TestProjects/MgmtParent/readme.md @@ -0,0 +1,22 @@ +# MgmtParent +### AutoRest Configuration +> see https://aka.ms/autorest + +``` yaml +azure-arm: true +require: $(this-folder)/../../../readme.md +input-file: $(this-folder)/mgmtParent.json +namespace: MgmtParent +model-namespace: false +public-clients: false +head-as-boolean: false +payload-flattening-threshold: 2 +operation-group-to-resource-type: + VirtualMachineExtensionImages: Microsoft.Compute/locations/publishers/vmextension +operation-group-to-resource: + VirtualMachineExtensionImages: VirtualMachineExtensionImage +operation-group-to-parent: + VirtualMachineExtensionImages: Microsoft.Compute/locations/publishers +modelerfour: + lenient-model-deduplication: true +``` diff --git a/test/TestProjects/ModelNamespace/Generated/Configuration.json b/test/TestProjects/ModelNamespace/Generated/Configuration.json index 8c99bcd38d0..51efb4966e0 100644 --- a/test/TestProjects/ModelNamespace/Generated/Configuration.json +++ b/test/TestProjects/ModelNamespace/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"ModelNamespace","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":false,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"ModelNamespace","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":false,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestProjects/ModelShapes/Generated/Configuration.json b/test/TestProjects/ModelShapes/Generated/Configuration.json index 0b9602fa606..0095db1474c 100644 --- a/test/TestProjects/ModelShapes/Generated/Configuration.json +++ b/test/TestProjects/ModelShapes/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"ModelShapes","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"ModelShapes","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestProjects/ModelWithConverterUsage/Generated/Configuration.json b/test/TestProjects/ModelWithConverterUsage/Generated/Configuration.json index 7311d13e731..aa144ae847d 100644 --- a/test/TestProjects/ModelWithConverterUsage/Generated/Configuration.json +++ b/test/TestProjects/ModelWithConverterUsage/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"ModelWithConverterUsage","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"ModelWithConverterUsage","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestProjects/NameConflicts/Generated/Configuration.json b/test/TestProjects/NameConflicts/Generated/Configuration.json index ffbadb6e5f2..7da788cbaaa 100644 --- a/test/TestProjects/NameConflicts/Generated/Configuration.json +++ b/test/TestProjects/NameConflicts/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"NameConflicts","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"NameConflicts","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestProjects/OperationGroupMappings/Generated/Configuration.json b/test/TestProjects/OperationGroupMappings/Generated/Configuration.json index 222713e578e..975ea0ff0b0 100644 --- a/test/TestProjects/OperationGroupMappings/Generated/Configuration.json +++ b/test/TestProjects/OperationGroupMappings/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"OperationGroupMappings","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":true,"PublicClients":true,"ModelNamespace":false,"HeadAsBoolean":true,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{"Operations":"/providers/Microsoft.Compute/operations"},"OperationGroupToResource":{"Operations":"Operation","AvailabilitySets":"AvailabilitySet"},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"OperationGroupMappings","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":true,"PublicClients":true,"ModelNamespace":false,"HeadAsBoolean":true,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{"Operations":"Microsoft.Compute/operations"},"OperationGroupToResource":{"Operations":"Operation","AvailabilitySets":"AvailabilitySet"},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestProjects/OperationGroupMappings/readme.md b/test/TestProjects/OperationGroupMappings/readme.md index 7f087dadb43..f87f7366a55 100644 --- a/test/TestProjects/OperationGroupMappings/readme.md +++ b/test/TestProjects/OperationGroupMappings/readme.md @@ -10,7 +10,7 @@ model-namespace: false input-file: $(this-folder)/OperationGroupMappings.json namespace: Azure.OperationGroupMappings operation-group-to-resource-type: - Operations: /providers/Microsoft.Compute/operations + Operations: Microsoft.Compute/operations operation-group-to-resource: Operations: Operation AvailabilitySets: AvailabilitySet diff --git a/test/TestProjects/PublicClientCtor/Generated/Configuration.json b/test/TestProjects/PublicClientCtor/Generated/Configuration.json index d82de912c6a..bd41ab0149f 100644 --- a/test/TestProjects/PublicClientCtor/Generated/Configuration.json +++ b/test/TestProjects/PublicClientCtor/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"PublicClientCtor","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":["TokenCredential","AzureKeyCredential"],"CredentialScopes":["https://fakeendpoint.azure.com/.default","https://dummyendpoint.azure.com/.default"],"CredentialHeaderName":"fake-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"PublicClientCtor","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":["TokenCredential","AzureKeyCredential"],"CredentialScopes":["https://fakeendpoint.azure.com/.default","https://dummyendpoint.azure.com/.default"],"CredentialHeaderName":"fake-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestProjects/ResourceRename/Generated/CodeModel.yaml b/test/TestProjects/ResourceRename/Generated/CodeModel.yaml new file mode 100644 index 00000000000..400b5d6bb95 --- /dev/null +++ b/test/TestProjects/ResourceRename/Generated/CodeModel.yaml @@ -0,0 +1,471 @@ +!CodeModel +info: !Info + description: The Compute Management Client. + title: ComputeManagementClient +schemas: !Schemas + strings: + - !StringSchema &ref_0 + type: string + language: !Languages + default: + name: String + description: simple string + protocol: !Protocols {} + - !StringSchema &ref_3 + type: string + apiVersions: + - !ApiVersion + version: '2020-06-01' + language: !Languages + default: + name: String + description: '' + protocol: !Protocols {} + - !StringSchema &ref_1 + type: string + apiVersions: + - !ApiVersion + version: '2020-06-01' + language: !Languages + default: + name: SshPublicKeyResourcePath + description: 'Specifies the full path on the created VM where ssh public key is stored. If the file already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys' + protocol: !Protocols {} + - !StringSchema &ref_2 + type: string + apiVersions: + - !ApiVersion + version: '2020-06-01' + language: !Languages + default: + name: SshPublicKeyResourceKeyData + description: >- + SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit and in ssh-rsa format.

For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + protocol: !Protocols {} + constants: + - !ConstantSchema &ref_4 + type: constant + value: !ConstantValue + value: '2020-06-01' + valueType: *ref_0 + language: !Languages + default: + name: ApiVersion20200601 + description: Api Version (2020-06-01) + protocol: !Protocols {} + - !ConstantSchema &ref_8 + type: constant + value: !ConstantValue + value: application/json + valueType: *ref_0 + language: !Languages + default: + name: ApplicationJson + description: Content Type 'application/json' + protocol: !Protocols {} + - !ConstantSchema &ref_10 + type: constant + value: !ConstantValue + value: application/json + valueType: *ref_0 + language: !Languages + default: + name: Accept + description: 'Accept: application/json' + protocol: !Protocols {} + objects: + - !ObjectSchema &ref_9 + type: object + apiVersions: + - !ApiVersion + version: '2020-06-01' + properties: + - !Property &ref_12 + schema: *ref_1 + serializedName: path + language: !Languages + default: + name: path + description: 'Specifies the full path on the created VM where ssh public key is stored. If the file already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys' + protocol: !Protocols {} + - !Property &ref_13 + schema: *ref_2 + serializedName: keyData + language: !Languages + default: + name: keyData + description: >- + SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit and in ssh-rsa format.

For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in + Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + protocol: !Protocols {} + serializationFormats: + - json + usage: + - input + - output + language: !Languages + default: + name: SshPublicKeyResource + description: Contains information about SSH certificate public key and the path on the Linux VM where the public key is placed. + namespace: '' + protocol: !Protocols {} +globalParameters: + - !Parameter &ref_7 + schema: *ref_3 + implementation: Client + required: true + extensions: + x-ms-priority: 0 + language: !Languages + default: + name: SubscriptionId + description: Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + serializedName: subscriptionId + protocol: !Protocols + http: !HttpParameter + in: path + - !Parameter &ref_5 + schema: *ref_0 + clientDefaultValue: https://management.azure.com + implementation: Client + origin: modelerfour:synthesized/host + required: true + extensions: + x-ms-skip-url-encoding: true + language: !Languages + default: + name: $host + description: server parameter + serializedName: $host + protocol: !Protocols + http: !HttpParameter + in: uri + - !Parameter &ref_6 + schema: *ref_4 + implementation: Client + origin: modelerfour:synthesized/api-version + required: true + language: !Languages + default: + name: apiVersion + description: Api Version + serializedName: api-version + protocol: !Protocols + http: !HttpParameter + in: query +operationGroups: + - !OperationGroup + $key: SshPublicKeys + operations: + - !Operation + apiVersions: + - !ApiVersion + version: '2020-06-01' + parameters: + - *ref_5 + - !Parameter &ref_16 + schema: *ref_3 + implementation: Method + required: true + language: !Languages + default: + name: resourceGroupName + description: The name of the resource group. + serializedName: resourceGroupName + protocol: !Protocols + http: !HttpParameter + in: path + - !Parameter &ref_17 + schema: *ref_3 + implementation: Method + required: true + language: !Languages + default: + name: sshPublicKeyName + description: The name of the SSH public key. + serializedName: sshPublicKeyName + protocol: !Protocols + http: !HttpParameter + in: path + - *ref_6 + - *ref_7 + requests: + - !Request + parameters: + - !Parameter + schema: *ref_8 + implementation: Method + origin: modelerfour:synthesized/content-type + required: true + language: !Languages + default: + name: contentType + description: Body Parameter content-type + serializedName: Content-Type + protocol: !Protocols + http: !HttpParameter + in: header + - !Parameter &ref_11 + schema: *ref_9 + flattened: true + implementation: Method + required: true + language: !Languages + default: + name: parameters + description: Parameters supplied to create the SSH public key. + protocol: !Protocols + http: !HttpParameter + in: body + style: json + - !Parameter + schema: *ref_10 + implementation: Method + origin: modelerfour:synthesized/accept + required: true + language: !Languages + default: + name: accept + description: Accept header + serializedName: Accept + protocol: !Protocols + http: !HttpParameter + in: header + - !VirtualParameter &ref_14 + schema: *ref_1 + implementation: Method + originalParameter: *ref_11 + pathToProperty: [] + targetProperty: *ref_12 + language: !Languages + default: + name: path + description: 'Specifies the full path on the created VM where ssh public key is stored. If the file already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys' + protocol: !Protocols {} + - !VirtualParameter &ref_15 + schema: *ref_2 + implementation: Method + originalParameter: *ref_11 + pathToProperty: [] + targetProperty: *ref_13 + language: !Languages + default: + name: keyData + description: >- + SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit and in ssh-rsa format.

For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs + in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + protocol: !Protocols {} + signatureParameters: + - *ref_14 + - *ref_15 + language: !Languages + default: + name: '' + description: '' + protocol: !Protocols + http: !HttpWithBodyRequest + path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName} + method: put + knownMediaType: json + mediaTypes: + - application/json + uri: '{$host}' + signatureParameters: + - *ref_16 + - *ref_17 + responses: + - !SchemaResponse + schema: *ref_9 + language: !Languages + default: + name: '' + description: OK + protocol: !Protocols + http: !HttpResponse + knownMediaType: json + mediaTypes: + - application/json + statusCodes: + - '200' + - !SchemaResponse + schema: *ref_9 + language: !Languages + default: + name: '' + description: Created + protocol: !Protocols + http: !HttpResponse + knownMediaType: json + mediaTypes: + - application/json + statusCodes: + - '201' + language: !Languages + default: + name: Create + description: Creates a new SSH public key resource. + protocol: !Protocols {} + - !Operation + apiVersions: + - !ApiVersion + version: '2020-06-01' + parameters: + - *ref_5 + - !Parameter &ref_18 + schema: *ref_3 + implementation: Method + required: true + language: !Languages + default: + name: resourceGroupName + description: The name of the resource group. + serializedName: resourceGroupName + protocol: !Protocols + http: !HttpParameter + in: path + - !Parameter &ref_19 + schema: *ref_3 + implementation: Method + required: true + language: !Languages + default: + name: sshPublicKeyName + description: The name of the SSH public key. + serializedName: sshPublicKeyName + protocol: !Protocols + http: !HttpParameter + in: path + - *ref_6 + - *ref_7 + requests: + - !Request + language: !Languages + default: + name: '' + description: '' + protocol: !Protocols + http: !HttpRequest + path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName} + method: delete + uri: '{$host}' + signatureParameters: + - *ref_18 + - *ref_19 + responses: + - !Response + language: !Languages + default: + name: '' + description: OK + protocol: !Protocols + http: !HttpResponse + statusCodes: + - '200' + - !Response + language: !Languages + default: + name: '' + description: No Content + protocol: !Protocols + http: !HttpResponse + statusCodes: + - '204' + language: !Languages + default: + name: Delete + description: Delete an SSH public key. + protocol: !Protocols {} + - !Operation + apiVersions: + - !ApiVersion + version: '2020-06-01' + parameters: + - *ref_5 + - !Parameter &ref_20 + schema: *ref_3 + implementation: Method + required: true + language: !Languages + default: + name: resourceGroupName + description: The name of the resource group. + serializedName: resourceGroupName + protocol: !Protocols + http: !HttpParameter + in: path + - !Parameter &ref_21 + schema: *ref_3 + implementation: Method + required: true + language: !Languages + default: + name: sshPublicKeyName + description: The name of the SSH public key. + serializedName: sshPublicKeyName + protocol: !Protocols + http: !HttpParameter + in: path + - *ref_6 + - *ref_7 + requests: + - !Request + parameters: + - !Parameter + schema: *ref_10 + implementation: Method + origin: modelerfour:synthesized/accept + required: true + language: !Languages + default: + name: accept + description: Accept header + serializedName: Accept + protocol: !Protocols + http: !HttpParameter + in: header + signatureParameters: [] + language: !Languages + default: + name: '' + description: '' + protocol: !Protocols + http: !HttpRequest + path: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName} + method: get + uri: '{$host}' + signatureParameters: + - *ref_20 + - *ref_21 + responses: + - !SchemaResponse + schema: *ref_9 + language: !Languages + default: + name: '' + description: OK + protocol: !Protocols + http: !HttpResponse + knownMediaType: json + mediaTypes: + - application/json + statusCodes: + - '200' + language: !Languages + default: + name: Get + description: Retrieves information about an SSH public key. + protocol: !Protocols {} + language: !Languages + default: + name: SshPublicKeys + description: '' + protocol: !Protocols {} +security: !Security + authenticationRequired: true +language: !Languages + default: + name: ComputeManagementClient + description: '' +protocol: !Protocols + http: !HttpModel {} diff --git a/test/TestProjects/ResourceRename/Generated/Configuration.json b/test/TestProjects/ResourceRename/Generated/Configuration.json new file mode 100644 index 00000000000..8d0b909eda6 --- /dev/null +++ b/test/TestProjects/ResourceRename/Generated/Configuration.json @@ -0,0 +1 @@ +{"OutputFolder":".","Namespace":"ResourceRename","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":true,"PublicClients":true,"ModelNamespace":false,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{"SshPublicKeyResource":"SshPublicKeyInfo"},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestProjects/ResourceRename/Generated/Models/SshPublicKeyInfoData.Serialization.cs b/test/TestProjects/ResourceRename/Generated/Models/SshPublicKeyInfoData.Serialization.cs new file mode 100644 index 00000000000..a3634601fee --- /dev/null +++ b/test/TestProjects/ResourceRename/Generated/Models/SshPublicKeyInfoData.Serialization.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace ResourceRename +{ + public partial class SshPublicKeyInfoData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Path)) + { + writer.WritePropertyName("path"); + writer.WriteStringValue(Path); + } + if (Optional.IsDefined(KeyData)) + { + writer.WritePropertyName("keyData"); + writer.WriteStringValue(KeyData); + } + writer.WriteEndObject(); + } + + internal static SshPublicKeyInfoData DeserializeSshPublicKeyInfoData(JsonElement element) + { + Optional path = default; + Optional keyData = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("path")) + { + path = property.Value.GetString(); + continue; + } + if (property.NameEquals("keyData")) + { + keyData = property.Value.GetString(); + continue; + } + } + return new SshPublicKeyInfoData(path.Value, keyData.Value); + } + } +} diff --git a/test/TestProjects/ResourceRename/Generated/Models/SshPublicKeyInfoData.cs b/test/TestProjects/ResourceRename/Generated/Models/SshPublicKeyInfoData.cs new file mode 100644 index 00000000000..1c298dccd70 --- /dev/null +++ b/test/TestProjects/ResourceRename/Generated/Models/SshPublicKeyInfoData.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace ResourceRename +{ + /// A class representing the SshPublicKeyInfo data model. + public partial class SshPublicKeyInfoData + { + /// Initializes a new instance of SshPublicKeyInfoData. + public SshPublicKeyInfoData() + { + } + + /// Initializes a new instance of SshPublicKeyInfoData. + /// Specifies the full path on the created VM where ssh public key is stored. If the file already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys. + /// SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit and in ssh-rsa format. <br><br> For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + internal SshPublicKeyInfoData(string path, string keyData) + { + Path = path; + KeyData = keyData; + } + + /// Specifies the full path on the created VM where ssh public key is stored. If the file already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys. + public string Path { get; set; } + /// SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit and in ssh-rsa format. <br><br> For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + public string KeyData { get; set; } + } +} diff --git a/test/TestProjects/ResourceRename/Generated/SshPublicKeyInfo.cs b/test/TestProjects/ResourceRename/Generated/SshPublicKeyInfo.cs new file mode 100644 index 00000000000..6e7dd86ad1d --- /dev/null +++ b/test/TestProjects/ResourceRename/Generated/SshPublicKeyInfo.cs @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace ResourceRename +{ + /// A Class representing a SshPublicKeyInfo along with the instance operations that can be performed on it. + public class SshPublicKeyInfo : SshPublicKeyInfoOperations + { + } +} diff --git a/test/TestProjects/ResourceRename/Generated/SshPublicKeyInfoContainer.cs b/test/TestProjects/ResourceRename/Generated/SshPublicKeyInfoContainer.cs new file mode 100644 index 00000000000..e4a26625a13 --- /dev/null +++ b/test/TestProjects/ResourceRename/Generated/SshPublicKeyInfoContainer.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace ResourceRename +{ + /// A class representing collection of SshPublicKeyInfo and their operations over a [ParentResource]. + public partial class SshPublicKeyInfoContainer + { + /// Initializes a new instance of SshPublicKeyInfoContainer for mocking. + protected SshPublicKeyInfoContainer() + { + } + } +} diff --git a/test/TestProjects/ResourceRename/Generated/SshPublicKeyInfoOperations.cs b/test/TestProjects/ResourceRename/Generated/SshPublicKeyInfoOperations.cs new file mode 100644 index 00000000000..72df6b8e2b7 --- /dev/null +++ b/test/TestProjects/ResourceRename/Generated/SshPublicKeyInfoOperations.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace ResourceRename +{ + /// A class representing the operations that can be performed over a specific SshPublicKeyInfo. + public partial class SshPublicKeyInfoOperations + { + /// Initializes a new instance of SshPublicKeyInfoOperations for mocking. + protected SshPublicKeyInfoOperations() + { + } + } +} diff --git a/test/TestProjects/ResourceRename/Generated/SshPublicKeysRestOperations.cs b/test/TestProjects/ResourceRename/Generated/SshPublicKeysRestOperations.cs new file mode 100644 index 00000000000..8b531ea356a --- /dev/null +++ b/test/TestProjects/ResourceRename/Generated/SshPublicKeysRestOperations.cs @@ -0,0 +1,307 @@ +// 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; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace ResourceRename +{ + internal partial class SshPublicKeysRestOperations + { + private string subscriptionId; + private Uri endpoint; + private string apiVersion; + private ClientDiagnostics _clientDiagnostics; + private HttpPipeline _pipeline; + + /// Initializes a new instance of SshPublicKeysRestOperations. + /// The handler for diagnostic messaging in the client. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call. + /// server parameter. + /// Api Version. + /// or is null. + public SshPublicKeysRestOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscriptionId, Uri endpoint = null, string apiVersion = "2020-06-01") + { + if (subscriptionId == null) + { + throw new ArgumentNullException(nameof(subscriptionId)); + } + endpoint ??= new Uri("https://management.azure.com"); + if (apiVersion == null) + { + throw new ArgumentNullException(nameof(apiVersion)); + } + + this.subscriptionId = subscriptionId; + this.endpoint = endpoint; + this.apiVersion = apiVersion; + _clientDiagnostics = clientDiagnostics; + _pipeline = pipeline; + } + + internal HttpMessage CreateCreateRequest(string resourceGroupName, string sshPublicKeyName, string path, string keyData) + { + 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.Compute/sshPublicKeys/", false); + uri.AppendPath(sshPublicKeyName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var model = new SshPublicKeyInfoData() + { + Path = path, + KeyData = keyData + }; + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(model); + request.Content = content; + return message; + } + + /// Creates a new SSH public key resource. + /// The name of the resource group. + /// The name of the SSH public key. + /// Specifies the full path on the created VM where ssh public key is stored. If the file already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys. + /// SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit and in ssh-rsa format. <br><br> For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + /// The cancellation token to use. + /// or is null. + public async Task> CreateAsync(string resourceGroupName, string sshPublicKeyName, string path = null, string keyData = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (sshPublicKeyName == null) + { + throw new ArgumentNullException(nameof(sshPublicKeyName)); + } + + using var message = CreateCreateRequest(resourceGroupName, sshPublicKeyName, path, keyData); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + SshPublicKeyInfoData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SshPublicKeyInfoData.DeserializeSshPublicKeyInfoData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Creates a new SSH public key resource. + /// The name of the resource group. + /// The name of the SSH public key. + /// Specifies the full path on the created VM where ssh public key is stored. If the file already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys. + /// SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit and in ssh-rsa format. <br><br> For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). + /// The cancellation token to use. + /// or is null. + public Response Create(string resourceGroupName, string sshPublicKeyName, string path = null, string keyData = null, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (sshPublicKeyName == null) + { + throw new ArgumentNullException(nameof(sshPublicKeyName)); + } + + using var message = CreateCreateRequest(resourceGroupName, sshPublicKeyName, path, keyData); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + SshPublicKeyInfoData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SshPublicKeyInfoData.DeserializeSshPublicKeyInfoData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteRequest(string resourceGroupName, string sshPublicKeyName) + { + 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.Compute/sshPublicKeys/", false); + uri.AppendPath(sshPublicKeyName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + return message; + } + + /// Delete an SSH public key. + /// The name of the resource group. + /// The name of the SSH public key. + /// The cancellation token to use. + /// or is null. + public async Task DeleteAsync(string resourceGroupName, string sshPublicKeyName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (sshPublicKeyName == null) + { + throw new ArgumentNullException(nameof(sshPublicKeyName)); + } + + using var message = CreateDeleteRequest(resourceGroupName, sshPublicKeyName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Delete an SSH public key. + /// The name of the resource group. + /// The name of the SSH public key. + /// The cancellation token to use. + /// or is null. + public Response Delete(string resourceGroupName, string sshPublicKeyName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (sshPublicKeyName == null) + { + throw new ArgumentNullException(nameof(sshPublicKeyName)); + } + + using var message = CreateDeleteRequest(resourceGroupName, sshPublicKeyName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetRequest(string resourceGroupName, string sshPublicKeyName) + { + 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.Compute/sshPublicKeys/", false); + uri.AppendPath(sshPublicKeyName, true); + uri.AppendQuery("api-version", apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + return message; + } + + /// Retrieves information about an SSH public key. + /// The name of the resource group. + /// The name of the SSH public key. + /// The cancellation token to use. + /// or is null. + public async Task> GetAsync(string resourceGroupName, string sshPublicKeyName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (sshPublicKeyName == null) + { + throw new ArgumentNullException(nameof(sshPublicKeyName)); + } + + using var message = CreateGetRequest(resourceGroupName, sshPublicKeyName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SshPublicKeyInfoData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = SshPublicKeyInfoData.DeserializeSshPublicKeyInfoData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(message.Response).ConfigureAwait(false); + } + } + + /// Retrieves information about an SSH public key. + /// The name of the resource group. + /// The name of the SSH public key. + /// The cancellation token to use. + /// or is null. + public Response Get(string resourceGroupName, string sshPublicKeyName, CancellationToken cancellationToken = default) + { + if (resourceGroupName == null) + { + throw new ArgumentNullException(nameof(resourceGroupName)); + } + if (sshPublicKeyName == null) + { + throw new ArgumentNullException(nameof(sshPublicKeyName)); + } + + using var message = CreateGetRequest(resourceGroupName, sshPublicKeyName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SshPublicKeyInfoData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = SshPublicKeyInfoData.DeserializeSshPublicKeyInfoData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw _clientDiagnostics.CreateRequestFailedException(message.Response); + } + } + } +} diff --git a/test/TestProjects/ResourceRename/ResourceRename.csproj b/test/TestProjects/ResourceRename/ResourceRename.csproj new file mode 100644 index 00000000000..b56d216f16c --- /dev/null +++ b/test/TestProjects/ResourceRename/ResourceRename.csproj @@ -0,0 +1,17 @@ + + + + netstandard2.0 + true + annotations + + + + + + + + + + + diff --git a/test/TestProjects/ResourceRename/readme.md b/test/TestProjects/ResourceRename/readme.md new file mode 100644 index 00000000000..045c399e5f3 --- /dev/null +++ b/test/TestProjects/ResourceRename/readme.md @@ -0,0 +1,18 @@ +# ResourceRename +### AutoRest Configuration +> see https://aka.ms/autorest + +``` yaml +azure-arm: true +require: $(this-folder)/../../../readme.md +input-file: $(this-folder)/resourceRename.json +namespace: ResourceRename +model-namespace: false +public-clients: false +head-as-boolean: false +payload-flattening-threshold: 2 +resource-rename: + SshPublicKeyResource : SshPublicKeyInfo +modelerfour: + lenient-model-deduplication: true +``` diff --git a/test/TestProjects/ResourceRename/resourceRename.json b/test/TestProjects/ResourceRename/resourceRename.json new file mode 100644 index 00000000000..60eaca540fc --- /dev/null +++ b/test/TestProjects/ResourceRename/resourceRename.json @@ -0,0 +1,207 @@ +{ + "swagger": "2.0", + "info": { + "title": "ComputeManagementClient", + "description": "The Compute Management Client.", + "version": "2020-06-01" + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "paths": { + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/sshPublicKeys/{sshPublicKeyName}": { + "put": { + "tags": [ + "SshPublicKeys" + ], + "operationId": "SshPublicKeys_Create", + "description": "Creates a new SSH public key resource.", + "parameters": [ + { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group." + }, + { + "name": "sshPublicKeyName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the SSH public key." + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SshPublicKeyResource" + }, + "description": "Parameters supplied to create the SSH public key." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/SshPublicKeyResource" + } + }, + "201": { + "description": "Created", + "schema": { + "$ref": "#/definitions/SshPublicKeyResource" + } + } + }, + "x-ms-examples": { + "Create a new SSH public key resource.": { + "$ref": "./examples/CreateAnSshPublicKey.json" + } + } + }, + "delete": { + "tags": [ + "SshPublicKeys" + ], + "operationId": "SshPublicKeys_Delete", + "description": "Delete an SSH public key.", + "parameters": [ + { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group." + }, + { + "name": "sshPublicKeyName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the SSH public key." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "OK" + }, + "204": { + "description": "No Content" + } + } + }, + "get": { + "tags": [ + "SshPublicKeys" + ], + "operationId": "SshPublicKeys_Get", + "description": "Retrieves information about an SSH public key.", + "parameters": [ + { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group." + }, + { + "name": "sshPublicKeyName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the SSH public key." + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "$ref": "#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/SshPublicKeyResource" + } + } + }, + "x-ms-examples": { + "Get an ssh public key.": { + "$ref": "./examples/GetAnSshPublicKey.json" + } + } + } + } + }, + "definitions": { + "SshPublicKeyResource": { + "properties": { + "path": { + "type": "string", + "description": "Specifies the full path on the created VM where ssh public key is stored. If the file already exists, the specified key is appended to the file. Example: /home/user/.ssh/authorized_keys" + }, + "keyData": { + "type": "string", + "description": "SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit and in ssh-rsa format.

For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-mac-create-ssh-keys?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)." + } + }, + "description": "Contains information about SSH certificate public key and the path on the Linux VM where the public key is placed." + } + }, + "parameters": { + "SubscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "required": true, + "type": "string", + "description": "Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call." + }, + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "Client Api Version." + } + } +} diff --git a/test/TestProjects/TenantOnly/Generated/Configuration.json b/test/TestProjects/TenantOnly/Generated/Configuration.json index aa4c0fc6691..e66df799fb0 100644 --- a/test/TestProjects/TenantOnly/Generated/Configuration.json +++ b/test/TestProjects/TenantOnly/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"TenantOnly","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":true,"PublicClients":true,"ModelNamespace":false,"HeadAsBoolean":true,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{"AvailableBalances":"Microsoft.Billing/billingAccounts/availableBalance","Agreements":"Microsoft.Billing/billingAccounts/agreements"},"OperationGroupToResource":{"BillingAccounts":"BillingAccount","AvailableBalances":"AvailableBalance","Agreements":"Agreement"},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"TenantOnly","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":true,"PublicClients":true,"ModelNamespace":false,"HeadAsBoolean":true,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{"AvailableBalances":"Microsoft.Billing/billingAccounts/billingProfiles/availableBalance","Agreements":"Microsoft.Billing/billingAccounts/agreements"},"OperationGroupToResource":{"BillingAccounts":"BillingAccount","AvailableBalances":"AvailableBalance","Agreements":"Agreement"},"ResourceRename":{},"OperationGroupToParent":{"Instructions":"Microsoft.Billing/billingAccounts/billingProfiles"}} \ No newline at end of file diff --git a/test/TestProjects/TenantOnly/readme.md b/test/TestProjects/TenantOnly/readme.md index 1e41a83b80c..93bfe2ff8ab 100644 --- a/test/TestProjects/TenantOnly/readme.md +++ b/test/TestProjects/TenantOnly/readme.md @@ -10,10 +10,12 @@ model-namespace: false input-file: $(this-folder)/TenantOnly.json namespace: Azure.OperationGroupMappings operation-group-to-resource-type: - AvailableBalances : Microsoft.Billing/billingAccounts/availableBalance + AvailableBalances : Microsoft.Billing/billingAccounts/billingProfiles/availableBalance Agreements: "Microsoft.Billing/billingAccounts/agreements" operation-group-to-resource: BillingAccounts: BillingAccount AvailableBalances: AvailableBalance Agreements: Agreement +operation-group-to-parent: + Instructions: Microsoft.Billing/billingAccounts/billingProfiles ``` diff --git a/test/TestProjects/TypeSchemaMapping/Generated/Configuration.json b/test/TestProjects/TypeSchemaMapping/Generated/Configuration.json index 67da662658c..50356d7ed18 100644 --- a/test/TestProjects/TypeSchemaMapping/Generated/Configuration.json +++ b/test/TestProjects/TypeSchemaMapping/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"TypeSchemaMapping","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"TypeSchemaMapping","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/additionalProperties/Generated/Configuration.json b/test/TestServerProjects/additionalProperties/Generated/Configuration.json index 3d91589cc13..da3c4f3a53c 100644 --- a/test/TestServerProjects/additionalProperties/Generated/Configuration.json +++ b/test/TestServerProjects/additionalProperties/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"additionalProperties","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"additionalProperties","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/azure-parameter-grouping/Generated/Configuration.json b/test/TestServerProjects/azure-parameter-grouping/Generated/Configuration.json index 22f1b1e3284..855fbf45f79 100644 --- a/test/TestServerProjects/azure-parameter-grouping/Generated/Configuration.json +++ b/test/TestServerProjects/azure-parameter-grouping/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"azure_parameter_grouping","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"azure_parameter_grouping","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/azure-special-properties/Generated/Configuration.json b/test/TestServerProjects/azure-special-properties/Generated/Configuration.json index 727f49c1595..dabb724b9dc 100644 --- a/test/TestServerProjects/azure-special-properties/Generated/Configuration.json +++ b/test/TestServerProjects/azure-special-properties/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"azure_special_properties","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"azure_special_properties","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/body-array/Generated/Configuration.json b/test/TestServerProjects/body-array/Generated/Configuration.json index 7354da92452..8cfd1ab0bcf 100644 --- a/test/TestServerProjects/body-array/Generated/Configuration.json +++ b/test/TestServerProjects/body-array/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"body_array","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"body_array","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/body-boolean/Generated/Configuration.json b/test/TestServerProjects/body-boolean/Generated/Configuration.json index 5325244854f..c879ac7be0f 100644 --- a/test/TestServerProjects/body-boolean/Generated/Configuration.json +++ b/test/TestServerProjects/body-boolean/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"body_boolean","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"body_boolean","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/body-byte/Generated/Configuration.json b/test/TestServerProjects/body-byte/Generated/Configuration.json index aa260b76193..45c721a85a2 100644 --- a/test/TestServerProjects/body-byte/Generated/Configuration.json +++ b/test/TestServerProjects/body-byte/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"body_byte","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"body_byte","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/body-complex/Generated/Configuration.json b/test/TestServerProjects/body-complex/Generated/Configuration.json index 7849a33c9c8..05f8e1fba8a 100644 --- a/test/TestServerProjects/body-complex/Generated/Configuration.json +++ b/test/TestServerProjects/body-complex/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"body_complex","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"body_complex","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/body-date/Generated/Configuration.json b/test/TestServerProjects/body-date/Generated/Configuration.json index 725dc3e6d08..b2d14538505 100644 --- a/test/TestServerProjects/body-date/Generated/Configuration.json +++ b/test/TestServerProjects/body-date/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"body_date","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"body_date","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/body-datetime-rfc1123/Generated/Configuration.json b/test/TestServerProjects/body-datetime-rfc1123/Generated/Configuration.json index 69af6dc91d0..71d7a2f3c51 100644 --- a/test/TestServerProjects/body-datetime-rfc1123/Generated/Configuration.json +++ b/test/TestServerProjects/body-datetime-rfc1123/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"body_datetime_rfc1123","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"body_datetime_rfc1123","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/body-datetime/Generated/Configuration.json b/test/TestServerProjects/body-datetime/Generated/Configuration.json index e63aed6f86b..fc83c4d29a9 100644 --- a/test/TestServerProjects/body-datetime/Generated/Configuration.json +++ b/test/TestServerProjects/body-datetime/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"body_datetime","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"body_datetime","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/body-dictionary/Generated/Configuration.json b/test/TestServerProjects/body-dictionary/Generated/Configuration.json index 44632d9254a..34a14bb8b2d 100644 --- a/test/TestServerProjects/body-dictionary/Generated/Configuration.json +++ b/test/TestServerProjects/body-dictionary/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"body_dictionary","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"body_dictionary","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/body-duration/Generated/Configuration.json b/test/TestServerProjects/body-duration/Generated/Configuration.json index 22e2c2a20bb..729f3010cc6 100644 --- a/test/TestServerProjects/body-duration/Generated/Configuration.json +++ b/test/TestServerProjects/body-duration/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"body_duration","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"body_duration","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/body-file/Generated/Configuration.json b/test/TestServerProjects/body-file/Generated/Configuration.json index 9302beb5755..53186e978c6 100644 --- a/test/TestServerProjects/body-file/Generated/Configuration.json +++ b/test/TestServerProjects/body-file/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"body_file","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"body_file","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/body-formdata-urlencoded/Generated/Configuration.json b/test/TestServerProjects/body-formdata-urlencoded/Generated/Configuration.json index 3c65f33357a..0db75986dfe 100644 --- a/test/TestServerProjects/body-formdata-urlencoded/Generated/Configuration.json +++ b/test/TestServerProjects/body-formdata-urlencoded/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"body_formdata_urlencoded","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"body_formdata_urlencoded","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/body-formdata/Generated/Configuration.json b/test/TestServerProjects/body-formdata/Generated/Configuration.json index 888091e6dfb..319b9750a82 100644 --- a/test/TestServerProjects/body-formdata/Generated/Configuration.json +++ b/test/TestServerProjects/body-formdata/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"body_formdata","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"body_formdata","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/body-integer/Generated/Configuration.json b/test/TestServerProjects/body-integer/Generated/Configuration.json index 55d5eae5862..29a901879b8 100644 --- a/test/TestServerProjects/body-integer/Generated/Configuration.json +++ b/test/TestServerProjects/body-integer/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"body_integer","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"body_integer","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/body-number/Generated/Configuration.json b/test/TestServerProjects/body-number/Generated/Configuration.json index 8bf1d6179c6..f5141039290 100644 --- a/test/TestServerProjects/body-number/Generated/Configuration.json +++ b/test/TestServerProjects/body-number/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"body_number","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"body_number","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/body-string/Generated/Configuration.json b/test/TestServerProjects/body-string/Generated/Configuration.json index 363e90f5b33..2ea13e5c368 100644 --- a/test/TestServerProjects/body-string/Generated/Configuration.json +++ b/test/TestServerProjects/body-string/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"body_string","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"body_string","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/body-time/Generated/Configuration.json b/test/TestServerProjects/body-time/Generated/Configuration.json index 19ab7319b68..ba41b7ac933 100644 --- a/test/TestServerProjects/body-time/Generated/Configuration.json +++ b/test/TestServerProjects/body-time/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"body_time","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"body_time","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/constants/Generated/Configuration.json b/test/TestServerProjects/constants/Generated/Configuration.json index baa0e9c18b4..eca912f297b 100644 --- a/test/TestServerProjects/constants/Generated/Configuration.json +++ b/test/TestServerProjects/constants/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"constants","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"constants","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/custom-baseUrl-more-options/Generated/Configuration.json b/test/TestServerProjects/custom-baseUrl-more-options/Generated/Configuration.json index 237b4381487..7cf1925b31c 100644 --- a/test/TestServerProjects/custom-baseUrl-more-options/Generated/Configuration.json +++ b/test/TestServerProjects/custom-baseUrl-more-options/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"custom_baseUrl_more_options","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"custom_baseUrl_more_options","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/custom-baseUrl-paging/Generated/Configuration.json b/test/TestServerProjects/custom-baseUrl-paging/Generated/Configuration.json index 73eb5288a87..5c81d04a20d 100644 --- a/test/TestServerProjects/custom-baseUrl-paging/Generated/Configuration.json +++ b/test/TestServerProjects/custom-baseUrl-paging/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"custom_baseUrl_paging","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"custom_baseUrl_paging","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/custom-baseUrl/Generated/Configuration.json b/test/TestServerProjects/custom-baseUrl/Generated/Configuration.json index 65235f88e9b..65f868bcbbe 100644 --- a/test/TestServerProjects/custom-baseUrl/Generated/Configuration.json +++ b/test/TestServerProjects/custom-baseUrl/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"custom_baseUrl","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"custom_baseUrl","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/extensible-enums-swagger/Generated/Configuration.json b/test/TestServerProjects/extensible-enums-swagger/Generated/Configuration.json index df3d44e44b3..991f71661b9 100644 --- a/test/TestServerProjects/extensible-enums-swagger/Generated/Configuration.json +++ b/test/TestServerProjects/extensible-enums-swagger/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"extensible_enums_swagger","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"extensible_enums_swagger","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/head/Generated/Configuration.json b/test/TestServerProjects/head/Generated/Configuration.json index 382fd96e7e6..001c4e71032 100644 --- a/test/TestServerProjects/head/Generated/Configuration.json +++ b/test/TestServerProjects/head/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"head","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"head","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/header/Generated/Configuration.json b/test/TestServerProjects/header/Generated/Configuration.json index 4510eaca5d5..aa3694831bc 100644 --- a/test/TestServerProjects/header/Generated/Configuration.json +++ b/test/TestServerProjects/header/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"header","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"header","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/httpInfrastructure/Generated/Configuration.json b/test/TestServerProjects/httpInfrastructure/Generated/Configuration.json index dbe79e1b6eb..2c5e41e89f3 100644 --- a/test/TestServerProjects/httpInfrastructure/Generated/Configuration.json +++ b/test/TestServerProjects/httpInfrastructure/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"httpInfrastructure","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"httpInfrastructure","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/lro-parameterized-endpoints/Generated/Configuration.json b/test/TestServerProjects/lro-parameterized-endpoints/Generated/Configuration.json index ea519dbdbb0..2d2e9a584b8 100644 --- a/test/TestServerProjects/lro-parameterized-endpoints/Generated/Configuration.json +++ b/test/TestServerProjects/lro-parameterized-endpoints/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"lro_parameterized_endpoints","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"lro_parameterized_endpoints","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/lro/Generated/Configuration.json b/test/TestServerProjects/lro/Generated/Configuration.json index 459716d2679..af85acecc92 100644 --- a/test/TestServerProjects/lro/Generated/Configuration.json +++ b/test/TestServerProjects/lro/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"lro","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"lro","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/media_types/Generated/Configuration.json b/test/TestServerProjects/media_types/Generated/Configuration.json index 833cc91b2ff..ecb5094c796 100644 --- a/test/TestServerProjects/media_types/Generated/Configuration.json +++ b/test/TestServerProjects/media_types/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"media_types","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"media_types","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/model-flattening/Generated/Configuration.json b/test/TestServerProjects/model-flattening/Generated/Configuration.json index 70aff665751..49537b739e2 100644 --- a/test/TestServerProjects/model-flattening/Generated/Configuration.json +++ b/test/TestServerProjects/model-flattening/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"model_flattening","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"model_flattening","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/multiple-inheritance/Generated/Configuration.json b/test/TestServerProjects/multiple-inheritance/Generated/Configuration.json index a1fb32ad277..4da964006c3 100644 --- a/test/TestServerProjects/multiple-inheritance/Generated/Configuration.json +++ b/test/TestServerProjects/multiple-inheritance/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"multiple_inheritance","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"multiple_inheritance","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/non-string-enum/Generated/Configuration.json b/test/TestServerProjects/non-string-enum/Generated/Configuration.json index f19875c38cb..9788bc28428 100644 --- a/test/TestServerProjects/non-string-enum/Generated/Configuration.json +++ b/test/TestServerProjects/non-string-enum/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"non_string_enum","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"non_string_enum","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/object-type/Generated/Configuration.json b/test/TestServerProjects/object-type/Generated/Configuration.json index 521070a7ef3..bc5acf56eb2 100644 --- a/test/TestServerProjects/object-type/Generated/Configuration.json +++ b/test/TestServerProjects/object-type/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"object_type","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"object_type","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/paging/Generated/Configuration.json b/test/TestServerProjects/paging/Generated/Configuration.json index 8abad94ffbd..839c203e682 100644 --- a/test/TestServerProjects/paging/Generated/Configuration.json +++ b/test/TestServerProjects/paging/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"paging","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"paging","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/required-optional/Generated/Configuration.json b/test/TestServerProjects/required-optional/Generated/Configuration.json index 4604f930d6f..e1f3b26b40d 100644 --- a/test/TestServerProjects/required-optional/Generated/Configuration.json +++ b/test/TestServerProjects/required-optional/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"required_optional","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"required_optional","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/subscriptionId-apiVersion/Generated/Configuration.json b/test/TestServerProjects/subscriptionId-apiVersion/Generated/Configuration.json index f1463a17b6e..47bac1f9f70 100644 --- a/test/TestServerProjects/subscriptionId-apiVersion/Generated/Configuration.json +++ b/test/TestServerProjects/subscriptionId-apiVersion/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"subscriptionId_apiVersion","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"subscriptionId_apiVersion","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/url-multi-collectionFormat/Generated/Configuration.json b/test/TestServerProjects/url-multi-collectionFormat/Generated/Configuration.json index d9c9110bf79..08bc2ab42cc 100644 --- a/test/TestServerProjects/url-multi-collectionFormat/Generated/Configuration.json +++ b/test/TestServerProjects/url-multi-collectionFormat/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"url_multi_collectionFormat","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"url_multi_collectionFormat","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/url/Generated/Configuration.json b/test/TestServerProjects/url/Generated/Configuration.json index 73fa0bf943f..8bcc8133605 100644 --- a/test/TestServerProjects/url/Generated/Configuration.json +++ b/test/TestServerProjects/url/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"url","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"url","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/validation/Generated/Configuration.json b/test/TestServerProjects/validation/Generated/Configuration.json index 771ce666c9d..6c16ff0d5fe 100644 --- a/test/TestServerProjects/validation/Generated/Configuration.json +++ b/test/TestServerProjects/validation/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"validation","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"validation","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/xml-service/Generated/Configuration.json b/test/TestServerProjects/xml-service/Generated/Configuration.json index 01cbede6d63..2e9d640989f 100644 --- a/test/TestServerProjects/xml-service/Generated/Configuration.json +++ b/test/TestServerProjects/xml-service/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"xml_service","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"xml_service","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file diff --git a/test/TestServerProjects/xms-error-responses/Generated/Configuration.json b/test/TestServerProjects/xms-error-responses/Generated/Configuration.json index b40109fadc4..e8c7a3bf59e 100644 --- a/test/TestServerProjects/xms-error-responses/Generated/Configuration.json +++ b/test/TestServerProjects/xms-error-responses/Generated/Configuration.json @@ -1 +1 @@ -{"OutputFolder":".","Namespace":"xms_error_responses","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{}} \ No newline at end of file +{"OutputFolder":".","Namespace":"xms_error_responses","LibraryName":null,"SharedSourceFolders":["..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Generator.Shared","..\\..\\..\\..\\artifacts\\bin\\AutoRest.CSharp\\Debug\\netcoreapp3.1\\Azure.Core.Shared"],"AzureArm":false,"PublicClients":true,"ModelNamespace":true,"HeadAsBoolean":false,"SkipCSProjPackageReference":true,"LowLevelClient":false,"CredentialTypes":[],"CredentialScopes":[],"CredentialHeaderName":"api-key","OperationGroupToResourceType":{},"OperationGroupToResource":{},"ResourceRename":{},"OperationGroupToParent":{}} \ No newline at end of file