diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/tests/Scenario/DevTestLabArmTemplateTests.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/tests/Scenario/DevTestLabArmTemplateTests.cs index 2661e3d0e366c..ecad3a9c8dc4e 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/tests/Scenario/DevTestLabArmTemplateTests.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/tests/Scenario/DevTestLabArmTemplateTests.cs @@ -27,6 +27,7 @@ public async Task SetUp() } [RecordedTest] + [Ignore("Restore after Azure.ResourceManager 1.9.0 get released.")] public async Task ExistGetGetAll() { // GetAll diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/tests/Scenario/DevTestLabArtifactSourceTests.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/tests/Scenario/DevTestLabArtifactSourceTests.cs index a1d880748a420..f553a8385b5a5 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/tests/Scenario/DevTestLabArtifactSourceTests.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/tests/Scenario/DevTestLabArtifactSourceTests.cs @@ -21,6 +21,7 @@ public DevTestLabArtifactSourceTests(bool isAsync) : base(isAsync) } [RecordedTest] + [Ignore("Restore after Azure.ResourceManager 1.9.0 get released.")] public async Task ExistGetGetAll() { // GetAll diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/tests/Scenario/DevTestLabArtifactTests.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/tests/Scenario/DevTestLabArtifactTests.cs index 7002df7362f52..af9557884d11c 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/tests/Scenario/DevTestLabArtifactTests.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/tests/Scenario/DevTestLabArtifactTests.cs @@ -27,6 +27,7 @@ public async Task SetUp() } [RecordedTest] + [Ignore("Restore after Azure.ResourceManager 1.9.0 get released.")] public async Task ExistGetGetAll() { // GetAll diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/tests/Scenario/DevTestLabTests.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/tests/Scenario/DevTestLabTests.cs index 0c6b83595e834..1215ae9b89b04 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/tests/Scenario/DevTestLabTests.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/tests/Scenario/DevTestLabTests.cs @@ -30,12 +30,14 @@ public void SetUp() } [RecordedTest] + [Ignore("Restore after Azure.ResourceManager 1.9.0 get released.")] public void CreateOrUpdate() { ValidateDevTestLab(TestDevTestLab.Data, _labName); } [RecordedTest] + [Ignore("Restore after Azure.ResourceManager 1.9.0 get released.")] public async Task Exist() { var flag = await _devTestLabCollections.ExistsAsync(_labName); @@ -43,6 +45,7 @@ public async Task Exist() } [RecordedTest] + [Ignore("Restore after Azure.ResourceManager 1.9.0 get released.")] public async Task Get() { var getlab = await _devTestLabCollections.GetAsync(_labName); @@ -50,6 +53,7 @@ public async Task Get() } [RecordedTest] + [Ignore("Restore after Azure.ResourceManager 1.9.0 get released.")] public async Task GetAll() { var first = (await _devTestLabCollections.GetAllAsync().ToEnumerableAsync()).FirstOrDefault(); @@ -57,6 +61,7 @@ public async Task GetAll() } [RecordedTest] + [Ignore("Restore after Azure.ResourceManager 1.9.0 get released.")] public async Task Delete() { await DeleteAllLocks(TestResourceGroup); @@ -68,6 +73,7 @@ public async Task Delete() [TestCase(null)] [TestCase(false)] [TestCase(true)] + [Ignore("Restore after Azure.ResourceManager 1.9.0 get released.")] public async Task AddRemoveTag(bool? useTagResource) { SetTagResourceUsage(Client, useTagResource); diff --git a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/tests/Scenario/DevTestLabVirtualNetworkTests.cs b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/tests/Scenario/DevTestLabVirtualNetworkTests.cs index 328f4c381de40..e473d54cd07dd 100644 --- a/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/tests/Scenario/DevTestLabVirtualNetworkTests.cs +++ b/sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/tests/Scenario/DevTestLabVirtualNetworkTests.cs @@ -38,12 +38,14 @@ public async Task SetUp() } [RecordedTest] + [Ignore("Restore after Azure.ResourceManager 1.9.0 get released.")] public void CreateOrUpdate() { ValidateDevTestLabVirtualNetwork(_dtlVnet.Data, _dtlVnetName); } [RecordedTest] + [Ignore("Restore after Azure.ResourceManager 1.9.0 get released.")] public async Task Exist() { var flag = await _dtlVnetCollection.ExistsAsync(_dtlVnetName); @@ -51,6 +53,7 @@ public async Task Exist() } [RecordedTest] + [Ignore("Restore after Azure.ResourceManager 1.9.0 get released.")] public async Task Get() { var getdtlVnet = await _dtlVnetCollection.GetAsync(_dtlVnetName); @@ -58,6 +61,7 @@ public async Task Get() } [RecordedTest] + [Ignore("Restore after Azure.ResourceManager 1.9.0 get released.")] public async Task GetAll() { var first = (await _dtlVnetCollection.GetAllAsync().ToEnumerableAsync()).FirstOrDefault(); @@ -65,6 +69,7 @@ public async Task GetAll() } [RecordedTest] + [Ignore("Restore after Azure.ResourceManager 1.9.0 get released.")] public async Task Delete() { await _dtlVnet.DeleteAsync(WaitUntil.Completed); diff --git a/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/tests/ScenarioTests/BackupProtectionContainerTests.cs b/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/tests/ScenarioTests/BackupProtectionContainerTests.cs index 079322a295582..9deaf8f96e52e 100644 --- a/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/tests/ScenarioTests/BackupProtectionContainerTests.cs +++ b/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/tests/ScenarioTests/BackupProtectionContainerTests.cs @@ -20,7 +20,8 @@ public BackupProtectionContainerTests(bool isAsnyc) { } - [Test] + [RecordedTest] + [Ignore("Restore after Azure.ResourceManager 1.9.0 get released.")] public async Task CreateTest() { var sub = await Client.GetDefaultSubscriptionAsync(); diff --git a/sdk/resourcemanager/Azure.ResourceManager/CHANGELOG.md b/sdk/resourcemanager/Azure.ResourceManager/CHANGELOG.md index 2754a23df6eef..58871a170c610 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/CHANGELOG.md +++ b/sdk/resourcemanager/Azure.ResourceManager/CHANGELOG.md @@ -1,16 +1,14 @@ # Release History -## 1.9.0-beta.1 (Unreleased) +## 1.9.0 (2023-11-14) ### Features Added -### Breaking Changes +- Bump api-version of `Lock` to `2020-05-01`. ### Bugs Fixed -### Other Changes - -## 1.8.1 (2023-11-13) +- Add the `Default` enum value back to `EnforcementMode`. ### Other Changes @@ -32,8 +30,8 @@ ### Other Changes -- Bump api-version of `Subscription` to `2022-12-01` -- Bump api-version of `Tenant` to `2022-12-01` +- Bump api-version of `Subscription` to `2022-12-01`. +- Bump api-version of `Tenant` to `2022-12-01`. ## 1.6.0 (2023-05-16) diff --git a/sdk/resourcemanager/Azure.ResourceManager/api/Azure.ResourceManager.netstandard2.0.cs b/sdk/resourcemanager/Azure.ResourceManager/api/Azure.ResourceManager.netstandard2.0.cs index 5bdaf69357362..017dfaa5133c0 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/api/Azure.ResourceManager.netstandard2.0.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/api/Azure.ResourceManager.netstandard2.0.cs @@ -1319,7 +1319,9 @@ internal DataPolicyManifestEffect() { } private readonly object _dummy; private readonly int _dummyPrimitive; public EnforcementMode(string value) { throw null; } + public static Azure.ResourceManager.Resources.Models.EnforcementMode Default { get { throw null; } } public static Azure.ResourceManager.Resources.Models.EnforcementMode DoNotEnforce { get { throw null; } } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.ResourceManager.Resources.Models.EnforcementMode Enforced { get { throw null; } } public bool Equals(Azure.ResourceManager.Resources.Models.EnforcementMode other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] diff --git a/sdk/resourcemanager/Azure.ResourceManager/assets.json b/sdk/resourcemanager/Azure.ResourceManager/assets.json index 09e11beb3d3c5..b43fdfb35bc78 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/assets.json +++ b/sdk/resourcemanager/Azure.ResourceManager/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/resourcemanager/Azure.ResourceManager", - "Tag": "net/resourcemanager/Azure.ResourceManager_bdcd46cf6b" + "Tag": "net/resourcemanager/Azure.ResourceManager_a6ac32475b" } diff --git a/sdk/resourcemanager/Azure.ResourceManager/samples/Generated/Samples/Sample_ManagementLockCollection.cs b/sdk/resourcemanager/Azure.ResourceManager/samples/Generated/Samples/Sample_ManagementLockCollection.cs index b11e6794913e7..ab25465c251a4 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/samples/Generated/Samples/Sample_ManagementLockCollection.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/samples/Generated/Samples/Sample_ManagementLockCollection.cs @@ -23,7 +23,7 @@ public partial class Sample_ManagementLockCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateManagementLockAtScope() { - // Generated from example definition: specification/resources/resource-manager/Microsoft.Authorization/stable/2016-09-01/examples/ManagementLocks_CreateOrUpdateAtScope.json + // Generated from example definition: specification/resources/resource-manager/Microsoft.Authorization/stable/2020-05-01/examples/ManagementLocks_CreateOrUpdateAtScope.json // this example is just showing the usage of "ManagementLocks_CreateOrUpdateByScope" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -57,7 +57,7 @@ public async Task CreateOrUpdate_CreateManagementLockAtScope() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetManagementLockAtScope() { - // Generated from example definition: specification/resources/resource-manager/Microsoft.Authorization/stable/2016-09-01/examples/ManagementLocks_GetAtScope.json + // Generated from example definition: specification/resources/resource-manager/Microsoft.Authorization/stable/2020-05-01/examples/ManagementLocks_GetAtScope.json // this example is just showing the usage of "ManagementLocks_GetByScope" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -89,7 +89,7 @@ public async Task Get_GetManagementLockAtScope() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetManagementLockAtScope() { - // Generated from example definition: specification/resources/resource-manager/Microsoft.Authorization/stable/2016-09-01/examples/ManagementLocks_GetAtScope.json + // Generated from example definition: specification/resources/resource-manager/Microsoft.Authorization/stable/2020-05-01/examples/ManagementLocks_GetAtScope.json // this example is just showing the usage of "ManagementLocks_GetByScope" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -117,7 +117,7 @@ public async Task Exists_GetManagementLockAtScope() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetManagementLockAtScope() { - // Generated from example definition: specification/resources/resource-manager/Microsoft.Authorization/stable/2016-09-01/examples/ManagementLocks_GetAtScope.json + // Generated from example definition: specification/resources/resource-manager/Microsoft.Authorization/stable/2020-05-01/examples/ManagementLocks_GetAtScope.json // this example is just showing the usage of "ManagementLocks_GetByScope" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -157,7 +157,7 @@ public async Task GetIfExists_GetManagementLockAtScope() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListManagementLocksAtScope() { - // Generated from example definition: specification/resources/resource-manager/Microsoft.Authorization/stable/2016-09-01/examples/ManagementLocks_ListAtScope.json + // Generated from example definition: specification/resources/resource-manager/Microsoft.Authorization/stable/2020-05-01/examples/ManagementLocks_ListAtScope.json // this example is just showing the usage of "ManagementLocks_ListByScope" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/resourcemanager/Azure.ResourceManager/samples/Generated/Samples/Sample_ManagementLockResource.cs b/sdk/resourcemanager/Azure.ResourceManager/samples/Generated/Samples/Sample_ManagementLockResource.cs index 0c27bb702cf1d..20addb12a334e 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/samples/Generated/Samples/Sample_ManagementLockResource.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/samples/Generated/Samples/Sample_ManagementLockResource.cs @@ -23,7 +23,7 @@ public partial class Sample_ManagementLockResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateManagementLockAtScope() { - // Generated from example definition: specification/resources/resource-manager/Microsoft.Authorization/stable/2016-09-01/examples/ManagementLocks_CreateOrUpdateAtScope.json + // Generated from example definition: specification/resources/resource-manager/Microsoft.Authorization/stable/2020-05-01/examples/ManagementLocks_CreateOrUpdateAtScope.json // this example is just showing the usage of "ManagementLocks_CreateOrUpdateByScope" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task Update_CreateManagementLockAtScope() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteManagementLockAtScope() { - // Generated from example definition: specification/resources/resource-manager/Microsoft.Authorization/stable/2016-09-01/examples/ManagementLocks_DeleteAtScope.json + // Generated from example definition: specification/resources/resource-manager/Microsoft.Authorization/stable/2020-05-01/examples/ManagementLocks_DeleteAtScope.json // this example is just showing the usage of "ManagementLocks_DeleteByScope" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -81,7 +81,7 @@ public async Task Delete_DeleteManagementLockAtScope() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetManagementLockAtScope() { - // Generated from example definition: specification/resources/resource-manager/Microsoft.Authorization/stable/2016-09-01/examples/ManagementLocks_GetAtScope.json + // Generated from example definition: specification/resources/resource-manager/Microsoft.Authorization/stable/2020-05-01/examples/ManagementLocks_GetAtScope.json // this example is just showing the usage of "ManagementLocks_GetByScope" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/resourcemanager/Azure.ResourceManager/samples/Generated/Samples/Sample_PolicyAssignmentCollection.cs b/sdk/resourcemanager/Azure.ResourceManager/samples/Generated/Samples/Sample_PolicyAssignmentCollection.cs index 755a43d6bb717..6b3a3c264c9d6 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/samples/Generated/Samples/Sample_PolicyAssignmentCollection.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/samples/Generated/Samples/Sample_PolicyAssignmentCollection.cs @@ -123,7 +123,7 @@ public async Task CreateOrUpdate_CreateOrUpdateAPolicyAssignmentWithASystemAssig { ["assignedBy"] = "Foo Bar" }), - EnforcementMode = new EnforcementMode("Default"), + EnforcementMode = EnforcementMode.Default, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, policyAssignmentName, data); PolicyAssignmentResource result = lro.Value; @@ -186,7 +186,7 @@ public async Task CreateOrUpdate_CreateOrUpdateAPolicyAssignmentWithAUserAssigne { ["assignedBy"] = "Foo Bar" }), - EnforcementMode = new EnforcementMode("Default"), + EnforcementMode = EnforcementMode.Default, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, policyAssignmentName, data); PolicyAssignmentResource result = lro.Value; diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Azure.ResourceManager.csproj b/sdk/resourcemanager/Azure.ResourceManager/src/Azure.ResourceManager.csproj index 531b1260d280b..89f666e7de0af 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Azure.ResourceManager.csproj +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Azure.ResourceManager.csproj @@ -1,9 +1,9 @@ - 1.9.0-beta.1 + 1.9.0 - 1.8.1 + 1.8.0 Azure.ResourceManager Microsoft Azure Resource Manager client SDK for Azure resources. azure;management;resource diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/ResourceManagerModelFactory.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/ResourceManagerModelFactory.cs index 21a1a1d08e7a9..9656f084f02c6 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/ResourceManagerModelFactory.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Common/Generated/ResourceManagerModelFactory.cs @@ -6,6 +6,7 @@ #nullable disable using System; +using System.Collections.Generic; using Azure; using Azure.Core; diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/ManagementGroupCollection.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/ManagementGroupCollection.cs index e8a78dc4f76ee..2867bbf55148f 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/ManagementGroupCollection.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/ManagementGroupCollection.cs @@ -253,7 +253,7 @@ public virtual AsyncPageable GetAllAsync(string cacheCo { HttpMessage FirstPageRequest(int? pageSizeHint) => _managementGroupRestClient.CreateListRequest(cacheControl, skiptoken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _managementGroupRestClient.CreateListNextPageRequest(nextLink, cacheControl, skiptoken); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ManagementGroupResource(Client, ManagementGroupData.DeserializeManagementGroupData(e)), _managementGroupClientDiagnostics, Pipeline, "ManagementGroupCollection.GetAll", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ManagementGroupResource(Client, ManagementGroupData.DeserializeManagementGroupData(e)), _managementGroupClientDiagnostics, Pipeline, "ManagementGroupCollection.GetAll", "value", "@nextLink", cancellationToken); } /// @@ -282,7 +282,7 @@ public virtual Pageable GetAll(string cacheControl = nu { HttpMessage FirstPageRequest(int? pageSizeHint) => _managementGroupRestClient.CreateListRequest(cacheControl, skiptoken); HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _managementGroupRestClient.CreateListNextPageRequest(nextLink, cacheControl, skiptoken); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ManagementGroupResource(Client, ManagementGroupData.DeserializeManagementGroupData(e)), _managementGroupClientDiagnostics, Pipeline, "ManagementGroupCollection.GetAll", "value", "nextLink", cancellationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ManagementGroupResource(Client, ManagementGroupData.DeserializeManagementGroupData(e)), _managementGroupClientDiagnostics, Pipeline, "ManagementGroupCollection.GetAll", "value", "@nextLink", cancellationToken); } /// diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupListResult.Serialization.cs b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupListResult.Serialization.cs index c9fab4e34ea30..ba2ebf4c8245d 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupListResult.Serialization.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/ManagementGroup/Generated/Models/ManagementGroupListResult.Serialization.cs @@ -38,7 +38,7 @@ internal static ManagementGroupListResult DeserializeManagementGroupListResult(J value = array; continue; } - if (property.NameEquals("nextLink"u8)) + if (property.NameEquals("@nextLink"u8)) { nextLink = property.Value.GetString(); continue; diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Custom/Models/EnforcementMode.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Custom/Models/EnforcementMode.cs new file mode 100644 index 0000000000000..ccb5c3feb6e54 --- /dev/null +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Custom/Models/EnforcementMode.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Resources.Models +{ + /// The policy assignment enforcement mode. Possible values are Default and DoNotEnforce. + public readonly partial struct EnforcementMode : IEquatable + { + private const string EnforcedValue = "Default"; + + /// The policy effect is enforced during resource creation or update. + [EditorBrowsable(EditorBrowsableState.Never)] + public static EnforcementMode Enforced { get; } = new EnforcementMode(EnforcedValue); + } +} diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Extensions/ArmClient.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Extensions/ArmClient.cs index aafe5e771b67a..3100a64e2e32c 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Extensions/ArmClient.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Extensions/ArmClient.cs @@ -24,42 +24,6 @@ public virtual PolicyAssignmentResource GetPolicyAssignmentResource(ResourceIden return new PolicyAssignmentResource(this, id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual ResourceProviderResource GetResourceProviderResource(ResourceIdentifier id) - { - ResourceProviderResource.ValidateResourceId(id); - return new ResourceProviderResource(this, id); - } - - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual ResourceGroupResource GetResourceGroupResource(ResourceIdentifier id) - { - ResourceGroupResource.ValidateResourceId(id); - return new ResourceGroupResource(this, id); - } - - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual TagResource GetTagResource(ResourceIdentifier id) - { - TagResource.ValidateResourceId(id); - return new TagResource(this, id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -156,6 +120,42 @@ public virtual ManagementLockResource GetManagementLockResource(ResourceIdentifi return new ManagementLockResource(this, id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ResourceProviderResource GetResourceProviderResource(ResourceIdentifier id) + { + ResourceProviderResource.ValidateResourceId(id); + return new ResourceProviderResource(this, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ResourceGroupResource GetResourceGroupResource(ResourceIdentifier id) + { + ResourceGroupResource.ValidateResourceId(id); + return new ResourceGroupResource(this, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual TagResource GetTagResource(ResourceIdentifier id) + { + TagResource.ValidateResourceId(id); + return new TagResource(this, id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/EnforcementMode.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/EnforcementMode.cs index 6bc0577adaa90..52220d75f658d 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/EnforcementMode.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/Models/EnforcementMode.cs @@ -22,11 +22,11 @@ public EnforcementMode(string value) _value = value ?? throw new ArgumentNullException(nameof(value)); } - private const string EnforcedValue = "Enforced"; + private const string DefaultValue = "Default"; private const string DoNotEnforceValue = "DoNotEnforce"; /// The policy effect is enforced during resource creation or update. - public static EnforcementMode Enforced { get; } = new EnforcementMode(EnforcedValue); + public static EnforcementMode Default { get; } = new EnforcementMode(DefaultValue); /// The policy effect is not enforced during resource creation or update. public static EnforcementMode DoNotEnforce { get; } = new EnforcementMode(DoNotEnforceValue); /// Determines if two values are the same. diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/ResourceManagerModelFactory.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/ResourceManagerModelFactory.cs index 5e4e8aabdb76f..09b37bf78c3a0 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/ResourceManagerModelFactory.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/ResourceManagerModelFactory.cs @@ -48,56 +48,83 @@ public static PolicyAssignmentData PolicyAssignmentData(ResourceIdentifier id = return new PolicyAssignmentData(id, name, resourceType, systemData, location, managedIdentity, displayName, policyDefinitionId, scope, excludedScopes?.ToList(), parameters, description, metadata, enforcementMode, nonComplianceMessages?.ToList(), resourceSelectors?.ToList(), overrides?.ToList()); } - /// Initializes a new instance of ResourceProviderData. - /// The provider ID. - /// The namespace of the resource provider. - /// The registration state of the resource provider. - /// The registration policy of the resource provider. - /// The collection of provider resource types. - /// The provider authorization consent state. - /// A new instance for mocking. - public static ResourceProviderData ResourceProviderData(ResourceIdentifier id = null, string @namespace = null, string registrationState = null, string registrationPolicy = null, IEnumerable resourceTypes = null, ProviderAuthorizationConsentState? providerAuthorizationConsentState = null) + /// Initializes a new instance of PolicyDefinitionData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The type of policy definition. Possible values are NotSpecified, BuiltIn, Custom, and Static. + /// The policy definition mode. Some examples are All, Indexed, Microsoft.KeyVault.Data. + /// The display name of the policy definition. + /// The policy definition description. + /// The policy rule. + /// The policy definition metadata. Metadata is an open ended object and is typically a collection of key value pairs. + /// The parameter definitions for parameters used in the policy rule. The keys are the parameter names. + /// A new instance for mocking. + public static PolicyDefinitionData PolicyDefinitionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, PolicyType? policyType = null, string mode = null, string displayName = null, string description = null, BinaryData policyRule = null, BinaryData metadata = null, IDictionary parameters = null) { - resourceTypes ??= new List(); + parameters ??= new Dictionary(); - return new ResourceProviderData(id, @namespace, registrationState, registrationPolicy, resourceTypes?.ToList(), providerAuthorizationConsentState); + return new PolicyDefinitionData(id, name, resourceType, systemData, policyType, mode, displayName, description, policyRule, metadata, parameters); } - /// Initializes a new instance of ProviderResourceType. - /// The resource type. - /// The collection of locations where this resource type can be created. - /// The location mappings that are supported by this resource type. - /// The aliases that are supported by this resource type. - /// The API version. - /// The default API version. - /// - /// The API profiles for the resource provider. - /// The additional capabilities offered by this resource type. - /// The properties. - /// A new instance for mocking. - public static ProviderResourceType ProviderResourceType(string resourceType = null, IEnumerable locations = null, IEnumerable locationMappings = null, IEnumerable aliases = null, IEnumerable apiVersions = null, string defaultApiVersion = null, IEnumerable zoneMappings = null, IEnumerable apiProfiles = null, string capabilities = null, IReadOnlyDictionary properties = null) + /// Initializes a new instance of PolicySetDefinitionData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The type of policy definition. Possible values are NotSpecified, BuiltIn, Custom, and Static. + /// The display name of the policy set definition. + /// The policy set definition description. + /// The policy set definition metadata. Metadata is an open ended object and is typically a collection of key value pairs. + /// The policy set definition parameters that can be used in policy definition references. + /// An array of policy definition references. + /// The metadata describing groups of policy definition references within the policy set definition. + /// A new instance for mocking. + public static PolicySetDefinitionData PolicySetDefinitionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, PolicyType? policyType = null, string displayName = null, string description = null, BinaryData metadata = null, IDictionary parameters = null, IEnumerable policyDefinitions = null, IEnumerable policyDefinitionGroups = null) { - locations ??= new List(); - locationMappings ??= new List(); - aliases ??= new List(); - apiVersions ??= new List(); - zoneMappings ??= new List(); - apiProfiles ??= new List(); - properties ??= new Dictionary(); + parameters ??= new Dictionary(); + policyDefinitions ??= new List(); + policyDefinitionGroups ??= new List(); - return new ProviderResourceType(resourceType, locations?.ToList(), locationMappings?.ToList(), aliases?.ToList(), apiVersions?.ToList(), defaultApiVersion, zoneMappings?.ToList(), apiProfiles?.ToList(), capabilities, properties); + return new PolicySetDefinitionData(id, name, resourceType, systemData, policyType, displayName, description, metadata, parameters, policyDefinitions?.ToList(), policyDefinitionGroups?.ToList()); } - /// Initializes a new instance of ProviderExtendedLocation. - /// The azure location. - /// The extended location type. - /// The extended locations for the azure location. - /// A new instance for mocking. - public static ProviderExtendedLocation ProviderExtendedLocation(AzureLocation? location = null, string providerExtendedLocationType = null, IEnumerable extendedLocations = null) + /// Initializes a new instance of DataPolicyManifestData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The list of namespaces for the data policy manifest. + /// The policy mode of the data policy manifest. + /// A value indicating whether policy mode is allowed only in built-in definitions. + /// An array of resource type aliases. + /// The effect definition. + /// The non-alias field accessor values that can be used in the policy rule. + /// The standard resource functions (subscription and/or resourceGroup). + /// An array of data manifest custom resource definition. + /// A new instance for mocking. + public static DataPolicyManifestData DataPolicyManifestData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable namespaces = null, string policyMode = null, bool? isBuiltInOnly = null, IEnumerable resourceTypeAliases = null, IEnumerable effects = null, IEnumerable fieldValues = null, IEnumerable standard = null, IEnumerable customDefinitions = null) { - extendedLocations ??= new List(); + namespaces ??= new List(); + resourceTypeAliases ??= new List(); + effects ??= new List(); + fieldValues ??= new List(); + standard ??= new List(); + customDefinitions ??= new List(); - return new ProviderExtendedLocation(location, providerExtendedLocationType, extendedLocations?.ToList()); + return new DataPolicyManifestData(id, name, resourceType, systemData, namespaces?.ToList(), policyMode, isBuiltInOnly, resourceTypeAliases?.ToList(), effects?.ToList(), fieldValues?.ToList(), standard?.ToList(), customDefinitions?.ToList()); + } + + /// Initializes a new instance of ResourceTypeAliases. + /// The resource type name. + /// The aliases for property names. + /// A new instance for mocking. + public static ResourceTypeAliases ResourceTypeAliases(string resourceType = null, IEnumerable aliases = null) + { + aliases ??= new List(); + + return new ResourceTypeAliases(resourceType, aliases?.ToList()); } /// Initializes a new instance of ResourceTypeAlias. @@ -147,6 +174,96 @@ public static ResourceTypeAliasPathMetadata ResourceTypeAliasPathMetadata(Resour return new ResourceTypeAliasPathMetadata(tokenType, attributes); } + /// Initializes a new instance of DataPolicyManifestEffect. + /// The data effect name. + /// The data effect details schema. + /// A new instance for mocking. + public static DataPolicyManifestEffect DataPolicyManifestEffect(string name = null, BinaryData detailsSchema = null) + { + return new DataPolicyManifestEffect(name, detailsSchema); + } + + /// Initializes a new instance of DataManifestCustomResourceFunctionDefinition. + /// The function name as it will appear in the policy rule. eg - 'vault'. + /// The fully qualified control plane resource type that this function represents. eg - 'Microsoft.KeyVault/vaults'. + /// The top-level properties that can be selected on the function's output. eg - [ "name", "location" ] if vault().name and vault().location are supported. + /// A value indicating whether the custom properties within the property bag are allowed. Needs api-version to be specified in the policy rule eg - vault('2019-06-01'). + /// A new instance for mocking. + public static DataManifestCustomResourceFunctionDefinition DataManifestCustomResourceFunctionDefinition(string name = null, ResourceType? fullyQualifiedResourceType = null, IEnumerable defaultProperties = null, bool? allowCustomProperties = null) + { + defaultProperties ??= new List(); + + return new DataManifestCustomResourceFunctionDefinition(name, fullyQualifiedResourceType, defaultProperties?.ToList(), allowCustomProperties); + } + + /// Initializes a new instance of ManagementLockData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The level of the lock. Possible values are: NotSpecified, CanNotDelete, ReadOnly. CanNotDelete means authorized users are able to read and modify the resources, but not delete. ReadOnly means authorized users can only read from a resource, but they can't modify or delete it. + /// Notes about the lock. Maximum of 512 characters. + /// The owners of the lock. + /// A new instance for mocking. + public static ManagementLockData ManagementLockData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ManagementLockLevel level = default, string notes = null, IEnumerable owners = null) + { + owners ??= new List(); + + return new ManagementLockData(id, name, resourceType, systemData, level, notes, owners?.ToList()); + } + + /// Initializes a new instance of ResourceProviderData. + /// The provider ID. + /// The namespace of the resource provider. + /// The registration state of the resource provider. + /// The registration policy of the resource provider. + /// The collection of provider resource types. + /// The provider authorization consent state. + /// A new instance for mocking. + public static ResourceProviderData ResourceProviderData(ResourceIdentifier id = null, string @namespace = null, string registrationState = null, string registrationPolicy = null, IEnumerable resourceTypes = null, ProviderAuthorizationConsentState? providerAuthorizationConsentState = null) + { + resourceTypes ??= new List(); + + return new ResourceProviderData(id, @namespace, registrationState, registrationPolicy, resourceTypes?.ToList(), providerAuthorizationConsentState); + } + + /// Initializes a new instance of ProviderResourceType. + /// The resource type. + /// The collection of locations where this resource type can be created. + /// The location mappings that are supported by this resource type. + /// The aliases that are supported by this resource type. + /// The API version. + /// The default API version. + /// + /// The API profiles for the resource provider. + /// The additional capabilities offered by this resource type. + /// The properties. + /// A new instance for mocking. + public static ProviderResourceType ProviderResourceType(string resourceType = null, IEnumerable locations = null, IEnumerable locationMappings = null, IEnumerable aliases = null, IEnumerable apiVersions = null, string defaultApiVersion = null, IEnumerable zoneMappings = null, IEnumerable apiProfiles = null, string capabilities = null, IReadOnlyDictionary properties = null) + { + locations ??= new List(); + locationMappings ??= new List(); + aliases ??= new List(); + apiVersions ??= new List(); + zoneMappings ??= new List(); + apiProfiles ??= new List(); + properties ??= new Dictionary(); + + return new ProviderResourceType(resourceType, locations?.ToList(), locationMappings?.ToList(), aliases?.ToList(), apiVersions?.ToList(), defaultApiVersion, zoneMappings?.ToList(), apiProfiles?.ToList(), capabilities, properties); + } + + /// Initializes a new instance of ProviderExtendedLocation. + /// The azure location. + /// The extended location type. + /// The extended locations for the azure location. + /// A new instance for mocking. + public static ProviderExtendedLocation ProviderExtendedLocation(AzureLocation? location = null, string providerExtendedLocationType = null, IEnumerable extendedLocations = null) + { + extendedLocations ??= new List(); + + return new ProviderExtendedLocation(location, providerExtendedLocationType, extendedLocations?.ToList()); + } + /// Initializes a new instance of ZoneMapping. /// The location of the zone mapping. /// @@ -333,123 +450,6 @@ public static TagResourceData TagResourceData(ResourceIdentifier id = null, stri return new TagResourceData(id, name, resourceType, systemData, tagValues != null ? new Tag(tagValues) : null); } - /// Initializes a new instance of PolicyDefinitionData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The type of policy definition. Possible values are NotSpecified, BuiltIn, Custom, and Static. - /// The policy definition mode. Some examples are All, Indexed, Microsoft.KeyVault.Data. - /// The display name of the policy definition. - /// The policy definition description. - /// The policy rule. - /// The policy definition metadata. Metadata is an open ended object and is typically a collection of key value pairs. - /// The parameter definitions for parameters used in the policy rule. The keys are the parameter names. - /// A new instance for mocking. - public static PolicyDefinitionData PolicyDefinitionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, PolicyType? policyType = null, string mode = null, string displayName = null, string description = null, BinaryData policyRule = null, BinaryData metadata = null, IDictionary parameters = null) - { - parameters ??= new Dictionary(); - - return new PolicyDefinitionData(id, name, resourceType, systemData, policyType, mode, displayName, description, policyRule, metadata, parameters); - } - - /// Initializes a new instance of PolicySetDefinitionData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The type of policy definition. Possible values are NotSpecified, BuiltIn, Custom, and Static. - /// The display name of the policy set definition. - /// The policy set definition description. - /// The policy set definition metadata. Metadata is an open ended object and is typically a collection of key value pairs. - /// The policy set definition parameters that can be used in policy definition references. - /// An array of policy definition references. - /// The metadata describing groups of policy definition references within the policy set definition. - /// A new instance for mocking. - public static PolicySetDefinitionData PolicySetDefinitionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, PolicyType? policyType = null, string displayName = null, string description = null, BinaryData metadata = null, IDictionary parameters = null, IEnumerable policyDefinitions = null, IEnumerable policyDefinitionGroups = null) - { - parameters ??= new Dictionary(); - policyDefinitions ??= new List(); - policyDefinitionGroups ??= new List(); - - return new PolicySetDefinitionData(id, name, resourceType, systemData, policyType, displayName, description, metadata, parameters, policyDefinitions?.ToList(), policyDefinitionGroups?.ToList()); - } - - /// Initializes a new instance of DataPolicyManifestData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The list of namespaces for the data policy manifest. - /// The policy mode of the data policy manifest. - /// A value indicating whether policy mode is allowed only in built-in definitions. - /// An array of resource type aliases. - /// The effect definition. - /// The non-alias field accessor values that can be used in the policy rule. - /// The standard resource functions (subscription and/or resourceGroup). - /// An array of data manifest custom resource definition. - /// A new instance for mocking. - public static DataPolicyManifestData DataPolicyManifestData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IEnumerable namespaces = null, string policyMode = null, bool? isBuiltInOnly = null, IEnumerable resourceTypeAliases = null, IEnumerable effects = null, IEnumerable fieldValues = null, IEnumerable standard = null, IEnumerable customDefinitions = null) - { - namespaces ??= new List(); - resourceTypeAliases ??= new List(); - effects ??= new List(); - fieldValues ??= new List(); - standard ??= new List(); - customDefinitions ??= new List(); - - return new DataPolicyManifestData(id, name, resourceType, systemData, namespaces?.ToList(), policyMode, isBuiltInOnly, resourceTypeAliases?.ToList(), effects?.ToList(), fieldValues?.ToList(), standard?.ToList(), customDefinitions?.ToList()); - } - - /// Initializes a new instance of ResourceTypeAliases. - /// The resource type name. - /// The aliases for property names. - /// A new instance for mocking. - public static ResourceTypeAliases ResourceTypeAliases(string resourceType = null, IEnumerable aliases = null) - { - aliases ??= new List(); - - return new ResourceTypeAliases(resourceType, aliases?.ToList()); - } - - /// Initializes a new instance of DataPolicyManifestEffect. - /// The data effect name. - /// The data effect details schema. - /// A new instance for mocking. - public static DataPolicyManifestEffect DataPolicyManifestEffect(string name = null, BinaryData detailsSchema = null) - { - return new DataPolicyManifestEffect(name, detailsSchema); - } - - /// Initializes a new instance of DataManifestCustomResourceFunctionDefinition. - /// The function name as it will appear in the policy rule. eg - 'vault'. - /// The fully qualified control plane resource type that this function represents. eg - 'Microsoft.KeyVault/vaults'. - /// The top-level properties that can be selected on the function's output. eg - [ "name", "location" ] if vault().name and vault().location are supported. - /// A value indicating whether the custom properties within the property bag are allowed. Needs api-version to be specified in the policy rule eg - vault('2019-06-01'). - /// A new instance for mocking. - public static DataManifestCustomResourceFunctionDefinition DataManifestCustomResourceFunctionDefinition(string name = null, ResourceType? fullyQualifiedResourceType = null, IEnumerable defaultProperties = null, bool? allowCustomProperties = null) - { - defaultProperties ??= new List(); - - return new DataManifestCustomResourceFunctionDefinition(name, fullyQualifiedResourceType, defaultProperties?.ToList(), allowCustomProperties); - } - - /// Initializes a new instance of ManagementLockData. - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The level of the lock. Possible values are: NotSpecified, CanNotDelete, ReadOnly. CanNotDelete means authorized users are able to read and modify the resources, but not delete. ReadOnly means authorized users can only read from a resource, but they can't modify or delete it. - /// Notes about the lock. Maximum of 512 characters. - /// The owners of the lock. - /// A new instance for mocking. - public static ManagementLockData ManagementLockData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ManagementLockLevel level = default, string notes = null, IEnumerable owners = null) - { - owners ??= new List(); - - return new ManagementLockData(id, name, resourceType, systemData, level, notes, owners?.ToList()); - } - /// Initializes a new instance of LocationExpanded. /// The fully qualified ID of the location. For example, /subscriptions/8d65815f-a5b6-402f-9298-045155da7d74/locations/westus. /// The subscription ID. diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/RestOperations/ManagementLocksRestOperations.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/RestOperations/ManagementLocksRestOperations.cs index bee6075198a98..c101ba7e86d1a 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/RestOperations/ManagementLocksRestOperations.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/RestOperations/ManagementLocksRestOperations.cs @@ -33,7 +33,7 @@ public ManagementLocksRestOperations(HttpPipeline pipeline, string applicationId { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2016-09-01"; + _apiVersion = apiVersion ?? "2020-05-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -132,6 +132,7 @@ internal HttpMessage CreateDeleteByScopeRequest(string scope, string lockName) uri.AppendPath(lockName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; + request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; } diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/SubscriptionResource.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/SubscriptionResource.cs index 0b1ed4ffb7305..8e97f38d71990 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/SubscriptionResource.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/SubscriptionResource.cs @@ -104,218 +104,218 @@ internal static void ValidateResourceId(ResourceIdentifier id) throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); } - /// Gets a collection of ResourceProviderResources in the Subscription. - /// An object representing collection of ResourceProviderResources and their operations over a ResourceProviderResource. - public virtual ResourceProviderCollection GetResourceProviders() + /// Gets a collection of SubscriptionPolicyDefinitionResources in the Subscription. + /// An object representing collection of SubscriptionPolicyDefinitionResources and their operations over a SubscriptionPolicyDefinitionResource. + public virtual SubscriptionPolicyDefinitionCollection GetSubscriptionPolicyDefinitions() { - return GetCachedClient(client => new ResourceProviderCollection(client, Id)); + return GetCachedClient(client => new SubscriptionPolicyDefinitionCollection(client, Id)); } /// - /// Gets the specified resource provider. + /// This operation retrieves the policy definition in the given subscription with the given name. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/{resourceProviderNamespace} + /// /subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName} /// /// /// Operation Id - /// Providers_Get + /// PolicyDefinitions_Get /// /// /// - /// The namespace of the resource provider. - /// The $expand query parameter. For example, to include property aliases in response, use $expand=resourceTypes/aliases. + /// The name of the policy definition to get. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetResourceProviderAsync(string resourceProviderNamespace, string expand = null, CancellationToken cancellationToken = default) + public virtual async Task> GetSubscriptionPolicyDefinitionAsync(string policyDefinitionName, CancellationToken cancellationToken = default) { - return await GetResourceProviders().GetAsync(resourceProviderNamespace, expand, cancellationToken).ConfigureAwait(false); + return await GetSubscriptionPolicyDefinitions().GetAsync(policyDefinitionName, cancellationToken).ConfigureAwait(false); } /// - /// Gets the specified resource provider. + /// This operation retrieves the policy definition in the given subscription with the given name. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/{resourceProviderNamespace} + /// /subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName} /// /// /// Operation Id - /// Providers_Get + /// PolicyDefinitions_Get /// /// /// - /// The namespace of the resource provider. - /// The $expand query parameter. For example, to include property aliases in response, use $expand=resourceTypes/aliases. + /// The name of the policy definition to get. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetResourceProvider(string resourceProviderNamespace, string expand = null, CancellationToken cancellationToken = default) + public virtual Response GetSubscriptionPolicyDefinition(string policyDefinitionName, CancellationToken cancellationToken = default) { - return GetResourceProviders().Get(resourceProviderNamespace, expand, cancellationToken); + return GetSubscriptionPolicyDefinitions().Get(policyDefinitionName, cancellationToken); } - /// Gets a collection of ResourceGroupResources in the Subscription. - /// An object representing collection of ResourceGroupResources and their operations over a ResourceGroupResource. - public virtual ResourceGroupCollection GetResourceGroups() + /// Gets a collection of SubscriptionPolicySetDefinitionResources in the Subscription. + /// An object representing collection of SubscriptionPolicySetDefinitionResources and their operations over a SubscriptionPolicySetDefinitionResource. + public virtual SubscriptionPolicySetDefinitionCollection GetSubscriptionPolicySetDefinitions() { - return GetCachedClient(client => new ResourceGroupCollection(client, Id)); + return GetCachedClient(client => new SubscriptionPolicySetDefinitionCollection(client, Id)); } /// - /// Gets a resource group. + /// This operation retrieves the policy set definition in the given subscription with the given name. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName} + /// /subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName} /// /// /// Operation Id - /// ResourceGroups_Get + /// PolicySetDefinitions_Get /// /// /// - /// The name of the resource group to get. The name is case insensitive. + /// The name of the policy set definition to get. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetResourceGroupAsync(string resourceGroupName, CancellationToken cancellationToken = default) + public virtual async Task> GetSubscriptionPolicySetDefinitionAsync(string policySetDefinitionName, CancellationToken cancellationToken = default) { - return await GetResourceGroups().GetAsync(resourceGroupName, cancellationToken).ConfigureAwait(false); + return await GetSubscriptionPolicySetDefinitions().GetAsync(policySetDefinitionName, cancellationToken).ConfigureAwait(false); } /// - /// Gets a resource group. + /// This operation retrieves the policy set definition in the given subscription with the given name. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName} + /// /subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName} /// /// /// Operation Id - /// ResourceGroups_Get + /// PolicySetDefinitions_Get /// /// /// - /// The name of the resource group to get. The name is case insensitive. + /// The name of the policy set definition to get. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetResourceGroup(string resourceGroupName, CancellationToken cancellationToken = default) + public virtual Response GetSubscriptionPolicySetDefinition(string policySetDefinitionName, CancellationToken cancellationToken = default) { - return GetResourceGroups().Get(resourceGroupName, cancellationToken); + return GetSubscriptionPolicySetDefinitions().Get(policySetDefinitionName, cancellationToken); } - /// Gets a collection of SubscriptionPolicyDefinitionResources in the Subscription. - /// An object representing collection of SubscriptionPolicyDefinitionResources and their operations over a SubscriptionPolicyDefinitionResource. - public virtual SubscriptionPolicyDefinitionCollection GetSubscriptionPolicyDefinitions() + /// Gets a collection of ResourceProviderResources in the Subscription. + /// An object representing collection of ResourceProviderResources and their operations over a ResourceProviderResource. + public virtual ResourceProviderCollection GetResourceProviders() { - return GetCachedClient(client => new SubscriptionPolicyDefinitionCollection(client, Id)); + return GetCachedClient(client => new ResourceProviderCollection(client, Id)); } /// - /// This operation retrieves the policy definition in the given subscription with the given name. + /// Gets the specified resource provider. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName} + /// /subscriptions/{subscriptionId}/providers/{resourceProviderNamespace} /// /// /// Operation Id - /// PolicyDefinitions_Get + /// Providers_Get /// /// /// - /// The name of the policy definition to get. + /// The namespace of the resource provider. + /// The $expand query parameter. For example, to include property aliases in response, use $expand=resourceTypes/aliases. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetSubscriptionPolicyDefinitionAsync(string policyDefinitionName, CancellationToken cancellationToken = default) + public virtual async Task> GetResourceProviderAsync(string resourceProviderNamespace, string expand = null, CancellationToken cancellationToken = default) { - return await GetSubscriptionPolicyDefinitions().GetAsync(policyDefinitionName, cancellationToken).ConfigureAwait(false); + return await GetResourceProviders().GetAsync(resourceProviderNamespace, expand, cancellationToken).ConfigureAwait(false); } /// - /// This operation retrieves the policy definition in the given subscription with the given name. + /// Gets the specified resource provider. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyDefinitions/{policyDefinitionName} + /// /subscriptions/{subscriptionId}/providers/{resourceProviderNamespace} /// /// /// Operation Id - /// PolicyDefinitions_Get + /// Providers_Get /// /// /// - /// The name of the policy definition to get. + /// The namespace of the resource provider. + /// The $expand query parameter. For example, to include property aliases in response, use $expand=resourceTypes/aliases. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetSubscriptionPolicyDefinition(string policyDefinitionName, CancellationToken cancellationToken = default) + public virtual Response GetResourceProvider(string resourceProviderNamespace, string expand = null, CancellationToken cancellationToken = default) { - return GetSubscriptionPolicyDefinitions().Get(policyDefinitionName, cancellationToken); + return GetResourceProviders().Get(resourceProviderNamespace, expand, cancellationToken); } - /// Gets a collection of SubscriptionPolicySetDefinitionResources in the Subscription. - /// An object representing collection of SubscriptionPolicySetDefinitionResources and their operations over a SubscriptionPolicySetDefinitionResource. - public virtual SubscriptionPolicySetDefinitionCollection GetSubscriptionPolicySetDefinitions() + /// Gets a collection of ResourceGroupResources in the Subscription. + /// An object representing collection of ResourceGroupResources and their operations over a ResourceGroupResource. + public virtual ResourceGroupCollection GetResourceGroups() { - return GetCachedClient(client => new SubscriptionPolicySetDefinitionCollection(client, Id)); + return GetCachedClient(client => new ResourceGroupCollection(client, Id)); } /// - /// This operation retrieves the policy set definition in the given subscription with the given name. + /// Gets a resource group. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName} + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName} /// /// /// Operation Id - /// PolicySetDefinitions_Get + /// ResourceGroups_Get /// /// /// - /// The name of the policy set definition to get. + /// The name of the resource group to get. The name is case insensitive. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetSubscriptionPolicySetDefinitionAsync(string policySetDefinitionName, CancellationToken cancellationToken = default) + public virtual async Task> GetResourceGroupAsync(string resourceGroupName, CancellationToken cancellationToken = default) { - return await GetSubscriptionPolicySetDefinitions().GetAsync(policySetDefinitionName, cancellationToken).ConfigureAwait(false); + return await GetResourceGroups().GetAsync(resourceGroupName, cancellationToken).ConfigureAwait(false); } /// - /// This operation retrieves the policy set definition in the given subscription with the given name. + /// Gets a resource group. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policySetDefinitions/{policySetDefinitionName} + /// /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName} /// /// /// Operation Id - /// PolicySetDefinitions_Get + /// ResourceGroups_Get /// /// /// - /// The name of the policy set definition to get. + /// The name of the resource group to get. The name is case insensitive. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetSubscriptionPolicySetDefinition(string policySetDefinitionName, CancellationToken cancellationToken = default) + public virtual Response GetResourceGroup(string resourceGroupName, CancellationToken cancellationToken = default) { - return GetSubscriptionPolicySetDefinitions().Get(policySetDefinitionName, cancellationToken); + return GetResourceGroups().Get(resourceGroupName, cancellationToken); } /// diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/TenantResource.cs b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/TenantResource.cs index 149f57bdf995d..8850c2c36930e 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/TenantResource.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/src/Resources/Generated/TenantResource.cs @@ -80,13 +80,6 @@ internal static void ValidateResourceId(ResourceIdentifier id) throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); } - /// Gets a collection of GenericResources in the Tenant. - /// An object representing collection of GenericResources and their operations over a GenericResource. - public virtual GenericResourceCollection GetGenericResources() - { - return GetCachedClient(client => new GenericResourceCollection(client, Id)); - } - /// Gets a collection of TenantPolicyDefinitionResources in the Tenant. /// An object representing collection of TenantPolicyDefinitionResources and their operations over a TenantPolicyDefinitionResource. public virtual TenantPolicyDefinitionCollection GetTenantPolicyDefinitions() @@ -246,6 +239,13 @@ public virtual Response GetDataPolicyManifest(string return GetDataPolicyManifests().Get(policyMode, cancellationToken); } + /// Gets a collection of GenericResources in the Tenant. + /// An object representing collection of GenericResources and their operations over a GenericResource. + public virtual GenericResourceCollection GetGenericResources() + { + return GetCachedClient(client => new GenericResourceCollection(client, Id)); + } + /// Gets a collection of SubscriptionResources in the Tenant. /// An object representing collection of SubscriptionResources and their operations over a SubscriptionResource. public virtual SubscriptionCollection GetSubscriptions() diff --git a/sdk/resourcemanager/Azure.ResourceManager/src/autorest.md b/sdk/resourcemanager/Azure.ResourceManager/src/autorest.md index 5677613a0862b..21a6fd3c8378a 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/src/autorest.md +++ b/sdk/resourcemanager/Azure.ResourceManager/src/autorest.md @@ -34,8 +34,8 @@ sample-gen: clear-output-folder: true namespace: Azure.ResourceManager input-file: - - https://raw.githubusercontent.com/Azure/azure-rest-api-specs/be8b6e1fc69e7c2700847d6a9c344c0e204294ce/specification/common-types/resource-management/v3/types.json - - https://raw.githubusercontent.com/Azure/azure-rest-api-specs/be8b6e1fc69e7c2700847d6a9c344c0e204294ce/specification/common-types/resource-management/v4/managedidentity.json + - https://github.com/Azure/azure-rest-api-specs/blob/78eac0bd58633028293cb1ec1709baa200bed9e2/specification/common-types/resource-management/v3/types.json + - https://github.com/Azure/azure-rest-api-specs/blob/78eac0bd58633028293cb1ec1709baa200bed9e2/specification/common-types/resource-management/v4/managedidentity.json format-by-name-rules: 'tenantId': 'uuid' @@ -177,15 +177,14 @@ sample-gen: namespace: Azure.ResourceManager.Resources title: ResourceManagementClient input-file: - - https://raw.githubusercontent.com/Azure/azure-rest-api-specs/b74978708bb95475562412d4654c00fbcedd9f89/specification/resources/resource-manager/Microsoft.Authorization/stable/2022-06-01/policyAssignments.json - - https://raw.githubusercontent.com/Azure/azure-rest-api-specs/b74978708bb95475562412d4654c00fbcedd9f89/specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/resources.json - - https://raw.githubusercontent.com/Azure/azure-rest-api-specs/b74978708bb95475562412d4654c00fbcedd9f89/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policyDefinitions.json - - https://raw.githubusercontent.com/Azure/azure-rest-api-specs/b74978708bb95475562412d4654c00fbcedd9f89/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policySetDefinitions.json - # - https://raw.githubusercontent.com/Azure/azure-rest-api-specs/91ac14531f0d05b3d6fcf4a817ea0defde59fe63/specification/resources/resource-manager/Microsoft.Authorization/preview/2020-07-01-preview/policyExemptions.json - - https://raw.githubusercontent.com/Azure/azure-rest-api-specs/b74978708bb95475562412d4654c00fbcedd9f89/specification/resources/resource-manager/Microsoft.Authorization/stable/2020-09-01/dataPolicyManifests.json - - https://raw.githubusercontent.com/Azure/azure-rest-api-specs/b74978708bb95475562412d4654c00fbcedd9f89/specification/resources/resource-manager/Microsoft.Authorization/stable/2016-09-01/locks.json - - https://raw.githubusercontent.com/Azure/azure-rest-api-specs/b74978708bb95475562412d4654c00fbcedd9f89/specification/resources/resource-manager/Microsoft.Resources/stable/2022-12-01/subscriptions.json - - https://raw.githubusercontent.com/Azure/azure-rest-api-specs/b74978708bb95475562412d4654c00fbcedd9f89/specification/resources/resource-manager/Microsoft.Features/stable/2021-07-01/features.json + - https://github.com/Azure/azure-rest-api-specs/blob/817861452040bf29d14b57ac7418560e4680e06e/specification/resources/resource-manager/Microsoft.Authorization/stable/2022-06-01/policyAssignments.json + - https://github.com/Azure/azure-rest-api-specs/blob/90a65cb3135d42438a381eb8bb5461a2b99b199f/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policyDefinitions.json + - https://github.com/Azure/azure-rest-api-specs/blob/90a65cb3135d42438a381eb8bb5461a2b99b199f/specification/resources/resource-manager/Microsoft.Authorization/stable/2021-06-01/policySetDefinitions.json + - https://github.com/Azure/azure-rest-api-specs/blob/78eac0bd58633028293cb1ec1709baa200bed9e2/specification/resources/resource-manager/Microsoft.Authorization/stable/2020-09-01/dataPolicyManifests.json + - https://github.com/Azure/azure-rest-api-specs/blob/78eac0bd58633028293cb1ec1709baa200bed9e2/specification/resources/resource-manager/Microsoft.Authorization/stable/2020-05-01/locks.json + - https://github.com/Azure/azure-rest-api-specs/blob/90a65cb3135d42438a381eb8bb5461a2b99b199f/specification/resources/resource-manager/Microsoft.Resources/stable/2022-09-01/resources.json + - https://github.com/Azure/azure-rest-api-specs/blob/78eac0bd58633028293cb1ec1709baa200bed9e2/specification/resources/resource-manager/Microsoft.Resources/stable/2022-12-01/subscriptions.json + - https://github.com/Azure/azure-rest-api-specs/blob/78eac0bd58633028293cb1ec1709baa200bed9e2/specification/resources/resource-manager/Microsoft.Features/stable/2021-07-01/features.json list-exception: - /{resourceId} request-path-to-resource-data: @@ -660,10 +659,6 @@ directive: where: $.definitions.ExportTemplateRequest transform: > $["x-ms-client-name"] = "ExportTemplate" - - from: policyAssignments.json - where: $.definitions.PolicyAssignmentProperties.properties.enforcementMode["x-ms-enum"].values[0] - transform: > - $["value"] = "Enforced" - from: dataPolicyManifests.json where: $.definitions.DataManifestCustomResourceFunctionDefinition.properties.fullyQualifiedResourceType transform: > @@ -706,7 +701,7 @@ sample-gen: namespace: Azure.ResourceManager.ManagementGroups title: ManagementClient input-file: - - https://raw.githubusercontent.com/Azure/azure-rest-api-specs/94a37114e8f4067410b52d3b1c75aa6e09180658/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/management.json + - https://github.com/Azure/azure-rest-api-specs/blob/90a65cb3135d42438a381eb8bb5461a2b99b199f/specification/managementgroups/resource-manager/Microsoft.Management/stable/2021-04-01/management.json request-path-to-parent: /providers/Microsoft.Management/checkNameAvailability: /providers/Microsoft.Management/managementGroups/{groupId} operation-positions: @@ -783,6 +778,10 @@ directive: $['x-ms-enum'] = { name: "ManagementGroupNameUnavailableReason" } + - from: management.json + where: $.definitions.ManagementGroupChildType + transform: > + $['x-ms-enum'].modelAsString = true - from: management.json where: $.definitions.CheckNameAvailabilityResult transform: > diff --git a/sdk/resourcemanager/Azure.ResourceManager/tests/Scenario/GenericResourceCollectionTests.cs b/sdk/resourcemanager/Azure.ResourceManager/tests/Scenario/GenericResourceCollectionTests.cs index b38222ef7a6b8..f51cc2fde4d61 100644 --- a/sdk/resourcemanager/Azure.ResourceManager/tests/Scenario/GenericResourceCollectionTests.cs +++ b/sdk/resourcemanager/Azure.ResourceManager/tests/Scenario/GenericResourceCollectionTests.cs @@ -25,16 +25,21 @@ public async Task Get() ResourceGroupResource rg = rgOp.Value; var aset = await CreateGenericAvailabilitySetAsync(rg.Id); - var genericResources = subscription.GetGenericResourcesAsync(); - GenericResource aset2 = null; - await foreach (GenericResource resource in genericResources) + for (int i = 0; i < 3; i++) { - if (resource.Data.Id == aset.Data.Id) + // Retry due to the delay of resource creation + var genericResources = subscription.GetGenericResourcesAsync(); + await foreach (GenericResource resource in genericResources) { - aset2 = resource; - break; + if (resource.Data.Id == aset.Data.Id) + { + aset2 = resource; + break; + } } + if (aset2 != null) + break; } AssertAreEqual(aset, aset2);