From 0d2fe9a30b667ef13cfee143814b4982f6ed52c6 Mon Sep 17 00:00:00 2001 From: Charlie Chen Date: Tue, 19 Nov 2024 07:54:39 +0000 Subject: [PATCH] Upgrade API spec version to 2023-06-01 --- .../Samples/Sample_MapsAccountCollection.cs | 74 +++++++- .../Samples/Sample_MapsAccountResource.cs | 72 ++++++-- .../Samples/Sample_MapsCreatorCollection.cs | 10 +- .../Samples/Sample_MapsCreatorResource.cs | 6 +- .../src/Generated/ArmMapsModelFactory.cs | 30 ++-- .../Generated/Extensions/MapsExtensions.cs | 8 +- .../MockableMapsResourceGroupResource.cs | 4 +- .../MockableMapsSubscriptionResource.cs | 4 +- .../src/Generated/MapsAccountCollection.cs | 20 +-- .../src/Generated/MapsAccountData.cs | 4 +- .../src/Generated/MapsAccountResource.cs | 40 ++--- .../src/Generated/MapsCreatorCollection.cs | 20 +-- .../src/Generated/MapsCreatorResource.cs | 24 +-- ...tomerManagedKeyEncryption.Serialization.cs | 148 ++++++++++++++++ .../Models/CustomerManagedKeyEncryption.cs | 69 ++++++++ ...dKeyEncryptionKeyIdentity.Serialization.cs | 163 ++++++++++++++++++ ...CustomerManagedKeyEncryptionKeyIdentity.cs | 74 ++++++++ .../Models/Encryption.Serialization.cs | 148 ++++++++++++++++ .../src/Generated/Models/Encryption.cs | 69 ++++++++ .../src/Generated/Models/IdentityType.cs | 54 ++++++ .../Models/InfrastructureEncryption.cs | 51 ++++++ .../Models/MapsAccountPatch.Serialization.cs | 16 ++ .../src/Generated/Models/MapsAccountPatch.cs | 23 ++- .../MapsAccountProperties.Serialization.cs | 16 ++ .../Generated/Models/MapsAccountProperties.cs | 19 +- .../Generated/Models/MapsAccountSasContent.cs | 18 +- .../src/Generated/Models/MapsSigningKey.cs | 5 +- .../RestOperations/AccountsRestOperations.cs | 2 +- .../RestOperations/CreatorsRestOperations.cs | 2 +- .../src/autorest.md | 2 +- 30 files changed, 1066 insertions(+), 129 deletions(-) create mode 100644 sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/CustomerManagedKeyEncryption.Serialization.cs create mode 100644 sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/CustomerManagedKeyEncryption.cs create mode 100644 sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/CustomerManagedKeyEncryptionKeyIdentity.Serialization.cs create mode 100644 sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/CustomerManagedKeyEncryptionKeyIdentity.cs create mode 100644 sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/Encryption.Serialization.cs create mode 100644 sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/Encryption.cs create mode 100644 sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/IdentityType.cs create mode 100644 sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/InfrastructureEncryption.cs diff --git a/sdk/maps/Azure.ResourceManager.Maps/samples/Generated/Samples/Sample_MapsAccountCollection.cs b/sdk/maps/Azure.ResourceManager.Maps/samples/Generated/Samples/Sample_MapsAccountCollection.cs index 3bf262843bd1..2e1d5717acb9 100644 --- a/sdk/maps/Azure.ResourceManager.Maps/samples/Generated/Samples/Sample_MapsAccountCollection.cs +++ b/sdk/maps/Azure.ResourceManager.Maps/samples/Generated/Samples/Sample_MapsAccountCollection.cs @@ -18,11 +18,71 @@ namespace Azure.ResourceManager.Maps.Samples { public partial class Sample_MapsAccountCollection { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateAccountWithEncryption() + { + // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/CreateAccountEncryption.json + // this example is just showing the usage of "Accounts_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "21a9967a-e8a9-4656-a70b-96ff1c4d05a0"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MapsAccountResource + MapsAccountCollection collection = resourceGroupResource.GetMapsAccounts(); + + // invoke the operation + string accountName = "myMapsAccount"; + MapsAccountData data = new MapsAccountData(new AzureLocation("eastus"), new MapsSku(MapsSkuName.G2)) + { + Kind = MapsAccountKind.Gen2, + Identity = new ManagedServiceIdentity("UserAssigned") + { + UserAssignedIdentities = +{ +[new ResourceIdentifier("/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName")] = new UserAssignedIdentity(), +}, + }, + Properties = new MapsAccountProperties() + { + Encryption = new Encryption() + { + CustomerManagedKeyEncryption = new CustomerManagedKeyEncryption() + { + KeyEncryptionKeyIdentity = new CustomerManagedKeyEncryptionKeyIdentity() + { + IdentityType = IdentityType.UserAssignedIdentity, + UserAssignedIdentityResourceId = new ResourceIdentifier("/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName"), + }, + KeyEncryptionKeyUri = new Uri("https://contosovault.vault.azure.net/keys/contosokek"), + }, + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, accountName, data); + MapsAccountResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MapsAccountData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + [Test] [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateAccountWithManagedIdentities() { - // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/CreateAccountManagedIdentity.json + // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/CreateAccountManagedIdentity.json // this example is just showing the usage of "Accounts_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -79,7 +139,7 @@ public async Task CreateOrUpdate_CreateAccountWithManagedIdentities() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateGen1Account() { - // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/CreateAccount.json + // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/CreateAccount.json // this example is just showing the usage of "Accounts_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -132,7 +192,7 @@ public async Task CreateOrUpdate_CreateGen1Account() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateGen2Account() { - // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/CreateAccountGen2.json + // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/CreateAccountGen2.json // this example is just showing the usage of "Accounts_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -185,7 +245,7 @@ public async Task CreateOrUpdate_CreateGen2Account() [Ignore("Only validating compilation of examples")] public async Task Get_GetAccount() { - // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/GetAccount.json + // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/GetAccount.json // this example is just showing the usage of "Accounts_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -218,7 +278,7 @@ public async Task Get_GetAccount() [Ignore("Only validating compilation of examples")] public async Task Exists_GetAccount() { - // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/GetAccount.json + // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/GetAccount.json // this example is just showing the usage of "Accounts_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -247,7 +307,7 @@ public async Task Exists_GetAccount() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetAccount() { - // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/GetAccount.json + // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/GetAccount.json // this example is just showing the usage of "Accounts_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -288,7 +348,7 @@ public async Task GetIfExists_GetAccount() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListAccountsByResourceGroup() { - // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/ListAccountsByResourceGroup.json + // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/ListAccountsByResourceGroup.json // this example is just showing the usage of "Accounts_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/maps/Azure.ResourceManager.Maps/samples/Generated/Samples/Sample_MapsAccountResource.cs b/sdk/maps/Azure.ResourceManager.Maps/samples/Generated/Samples/Sample_MapsAccountResource.cs index 42f242b3950b..97f21b6a4313 100644 --- a/sdk/maps/Azure.ResourceManager.Maps/samples/Generated/Samples/Sample_MapsAccountResource.cs +++ b/sdk/maps/Azure.ResourceManager.Maps/samples/Generated/Samples/Sample_MapsAccountResource.cs @@ -18,11 +18,63 @@ namespace Azure.ResourceManager.Maps.Samples { public partial class Sample_MapsAccountResource { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_UpdateAccountEncryption() + { + // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/UpdateAccountEncryption.json + // this example is just showing the usage of "Accounts_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MapsAccountResource created on azure + // for more information of creating MapsAccountResource, please refer to the document of MapsAccountResource + string subscriptionId = "21a9967a-e8a9-4656-a70b-96ff1c4d05a0"; + string resourceGroupName = "myResourceGroup"; + string accountName = "myMapsAccount"; + ResourceIdentifier mapsAccountResourceId = MapsAccountResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName); + MapsAccountResource mapsAccount = client.GetMapsAccountResource(mapsAccountResourceId); + + // invoke the operation + MapsAccountPatch patch = new MapsAccountPatch() + { + Identity = new ManagedServiceIdentity("SystemAssigned") + { + UserAssignedIdentities = +{ +[new ResourceIdentifier("/subscriptions/21a9967a-e8a9-4656-a70b-96ff1c4d05a0/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName")] = null, +}, + }, + Encryption = new Encryption() + { + CustomerManagedKeyEncryption = new CustomerManagedKeyEncryption() + { + KeyEncryptionKeyIdentity = new CustomerManagedKeyEncryptionKeyIdentity() + { + IdentityType = IdentityType.SystemAssignedIdentity, + UserAssignedIdentityResourceId = null, + }, + KeyEncryptionKeyUri = new Uri("https://contosovault.vault.azure.net/keys/contosokek"), + }, + }, + }; + MapsAccountResource result = await mapsAccount.UpdateAsync(patch); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MapsAccountData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + [Test] [Ignore("Only validating compilation of examples")] public async Task Update_UpdateAccountManagedIdentities() { - // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/UpdateAccountManagedIdentity.json + // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/UpdateAccountManagedIdentity.json // this example is just showing the usage of "Accounts_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -68,7 +120,7 @@ public async Task Update_UpdateAccountManagedIdentities() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateAccountTags() { - // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/UpdateAccount.json + // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/UpdateAccount.json // this example is just showing the usage of "Accounts_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -105,7 +157,7 @@ public async Task Update_UpdateAccountTags() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateToGen1Account() { - // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/UpdateAccountGen1.json + // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/UpdateAccountGen1.json // this example is just showing the usage of "Accounts_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -140,7 +192,7 @@ public async Task Update_UpdateToGen1Account() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateToGen2Account() { - // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/UpdateAccountGen2.json + // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/UpdateAccountGen2.json // this example is just showing the usage of "Accounts_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -175,7 +227,7 @@ public async Task Update_UpdateToGen2Account() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteAccount() { - // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/DeleteAccount.json + // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/DeleteAccount.json // this example is just showing the usage of "Accounts_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -201,7 +253,7 @@ public async Task Delete_DeleteAccount() [Ignore("Only validating compilation of examples")] public async Task Get_GetAccount() { - // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/GetAccount.json + // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/GetAccount.json // this example is just showing the usage of "Accounts_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -231,7 +283,7 @@ public async Task Get_GetAccount() [Ignore("Only validating compilation of examples")] public async Task GetMapsAccounts_ListAccountsBySubscription() { - // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/ListAccountsBySubscription.json + // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/ListAccountsBySubscription.json // this example is just showing the usage of "Accounts_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -262,7 +314,7 @@ public async Task GetMapsAccounts_ListAccountsBySubscription() [Ignore("Only validating compilation of examples")] public async Task GetSas_ListAccountSas() { - // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/AccountListSAS.json + // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/AccountListSAS.json // this example is just showing the usage of "Accounts_ListSas" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -295,7 +347,7 @@ public async Task GetSas_ListAccountSas() [Ignore("Only validating compilation of examples")] public async Task GetKeys_ListKeys() { - // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/ListKeys.json + // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/ListKeys.json // this example is just showing the usage of "Accounts_ListKeys" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -321,7 +373,7 @@ public async Task GetKeys_ListKeys() [Ignore("Only validating compilation of examples")] public async Task RegenerateKeys_RegenerateKey() { - // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/RegenerateKey.json + // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/RegenerateKey.json // this example is just showing the usage of "Accounts_RegenerateKeys" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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/maps/Azure.ResourceManager.Maps/samples/Generated/Samples/Sample_MapsCreatorCollection.cs b/sdk/maps/Azure.ResourceManager.Maps/samples/Generated/Samples/Sample_MapsCreatorCollection.cs index ac9f8d5e9ce0..0642345d40ce 100644 --- a/sdk/maps/Azure.ResourceManager.Maps/samples/Generated/Samples/Sample_MapsCreatorCollection.cs +++ b/sdk/maps/Azure.ResourceManager.Maps/samples/Generated/Samples/Sample_MapsCreatorCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MapsCreatorCollection [Ignore("Only validating compilation of examples")] public async Task GetAll_ListCreatorResourcesByAccount() { - // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/ListMapsCreatorsByAccount.json + // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/ListMapsCreatorsByAccount.json // this example is just showing the usage of "Creators_ListByAccount" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -56,7 +56,7 @@ public async Task GetAll_ListCreatorResourcesByAccount() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateCreatorResource() { - // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/CreateMapsCreator.json + // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/CreateMapsCreator.json // this example is just showing the usage of "Creators_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -98,7 +98,7 @@ public async Task CreateOrUpdate_CreateCreatorResource() [Ignore("Only validating compilation of examples")] public async Task Get_GetCreatorResource() { - // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/GetMapsCreator.json + // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/GetMapsCreator.json // this example is just showing the usage of "Creators_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -132,7 +132,7 @@ public async Task Get_GetCreatorResource() [Ignore("Only validating compilation of examples")] public async Task Exists_GetCreatorResource() { - // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/GetMapsCreator.json + // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/GetMapsCreator.json // this example is just showing the usage of "Creators_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -162,7 +162,7 @@ public async Task Exists_GetCreatorResource() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetCreatorResource() { - // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/GetMapsCreator.json + // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/GetMapsCreator.json // this example is just showing the usage of "Creators_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/maps/Azure.ResourceManager.Maps/samples/Generated/Samples/Sample_MapsCreatorResource.cs b/sdk/maps/Azure.ResourceManager.Maps/samples/Generated/Samples/Sample_MapsCreatorResource.cs index 8664a2d601e6..30ae174a909c 100644 --- a/sdk/maps/Azure.ResourceManager.Maps/samples/Generated/Samples/Sample_MapsCreatorResource.cs +++ b/sdk/maps/Azure.ResourceManager.Maps/samples/Generated/Samples/Sample_MapsCreatorResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MapsCreatorResource [Ignore("Only validating compilation of examples")] public async Task Update_UpdateCreatorResource() { - // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/UpdateMapsCreator.json + // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/UpdateMapsCreator.json // this example is just showing the usage of "Creators_Update" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -59,7 +59,7 @@ public async Task Update_UpdateCreatorResource() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteCreatorResource() { - // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/DeleteMapsCreator.json + // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/DeleteMapsCreator.json // this example is just showing the usage of "Creators_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +86,7 @@ public async Task Delete_DeleteCreatorResource() [Ignore("Only validating compilation of examples")] public async Task Get_GetCreatorResource() { - // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/preview/2021-12-01-preview/examples/GetMapsCreator.json + // Generated from example definition: specification/maps/resource-manager/Microsoft.Maps/stable/2023-06-01/examples/GetMapsCreator.json // this example is just showing the usage of "Creators_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/ArmMapsModelFactory.cs b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/ArmMapsModelFactory.cs index b899dabbe7bd..cdb1382fbc17 100644 --- a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/ArmMapsModelFactory.cs +++ b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/ArmMapsModelFactory.cs @@ -25,7 +25,7 @@ public static partial class ArmMapsModelFactory /// The location. /// The SKU of this account. /// Get or Set Kind property. - /// Sets the identity property for maps account. + /// Managed service identity (system assigned and/or user assigned identities). /// The map account properties. /// A new instance for mocking. public static MapsAccountData MapsAccountData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, MapsSku sku = null, MapsAccountKind? kind = null, ManagedServiceIdentity identity = null, MapsAccountProperties properties = null) @@ -57,12 +57,13 @@ public static MapsSku MapsSku(MapsSkuName name = default, string tier = null) /// Initializes a new instance of . /// A unique identifier for the maps account. - /// Allows toggle functionality on Azure Policy to disable Azure Maps local authentication support. This will disable Shared Keys authentication from any usage. - /// The provisioning state of the Map account resource. - /// Sets the resources to be used for Managed Identities based operations for the Map account resource. + /// Allows toggle functionality on Azure Policy to disable Azure Maps local authentication support. This will disable Shared Keys and Shared Access Signature Token authentication from any usage. + /// The provisioning state of the Map account resource, Account updates can only be performed on terminal states. Terminal states: `Succeeded` and `Failed`. + /// The array of associated resources to the Map account. Linked resource in the array cannot individually update, you must update all linked resources in the array together. These resources may be used on operations on the Azure Maps REST API. Access is controlled by the Map Account Managed Identity(s) permissions to those resource(s). /// Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Blob service. + /// (Optional) Discouraged to include in resource definition. Only needed where it is possible to disable platform (AKA infrastructure) encryption. Azure SQL TDE is an example of this. Values are enabled and disabled. /// A new instance for mocking. - public static MapsAccountProperties MapsAccountProperties(Guid? uniqueId = null, bool? disableLocalAuth = null, string provisioningState = null, IEnumerable linkedResources = null, IEnumerable corsRulesValue = null) + public static MapsAccountProperties MapsAccountProperties(Guid? uniqueId = null, bool? disableLocalAuth = null, string provisioningState = null, IEnumerable linkedResources = null, IEnumerable corsRulesValue = null, Encryption encryption = null) { linkedResources ??= new List(); corsRulesValue ??= new List(); @@ -73,6 +74,7 @@ public static MapsAccountProperties MapsAccountProperties(Guid? uniqueId = null, provisioningState, linkedResources?.ToList(), corsRulesValue != null ? new CorsRules(corsRulesValue?.ToList(), serializedAdditionalRawData: null) : null, + encryption, serializedAdditionalRawData: null); } @@ -80,14 +82,15 @@ public static MapsAccountProperties MapsAccountProperties(Guid? uniqueId = null, /// Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. /// Get or Set Kind property. /// The SKU of this account. - /// Sets the identity property for maps account. + /// Managed service identity (system assigned and/or user assigned identities). /// A unique identifier for the maps account. - /// Allows toggle functionality on Azure Policy to disable Azure Maps local authentication support. This will disable Shared Keys authentication from any usage. - /// The provisioning state of the Map account resource. - /// Sets the resources to be used for Managed Identities based operations for the Map account resource. + /// Allows toggle functionality on Azure Policy to disable Azure Maps local authentication support. This will disable Shared Keys and Shared Access Signature Token authentication from any usage. + /// The provisioning state of the Map account resource, Account updates can only be performed on terminal states. Terminal states: `Succeeded` and `Failed`. + /// The array of associated resources to the Map account. Linked resource in the array cannot individually update, you must update all linked resources in the array together. These resources may be used on operations on the Azure Maps REST API. Access is controlled by the Map Account Managed Identity(s) permissions to those resource(s). /// Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Blob service. + /// (Optional) Discouraged to include in resource definition. Only needed where it is possible to disable platform (AKA infrastructure) encryption. Azure SQL TDE is an example of this. Values are enabled and disabled. /// A new instance for mocking. - public static MapsAccountPatch MapsAccountPatch(IDictionary tags = null, MapsAccountKind? kind = null, MapsSku sku = null, ManagedServiceIdentity identity = null, Guid? uniqueId = null, bool? disableLocalAuth = null, string provisioningState = null, IEnumerable linkedResources = null, IEnumerable corsRulesValue = null) + public static MapsAccountPatch MapsAccountPatch(IDictionary tags = null, MapsAccountKind? kind = null, MapsSku sku = null, ManagedServiceIdentity identity = null, Guid? uniqueId = null, bool? disableLocalAuth = null, string provisioningState = null, IEnumerable linkedResources = null, IEnumerable corsRulesValue = null, Encryption encryption = null) { tags ??= new Dictionary(); linkedResources ??= new List(); @@ -103,16 +106,17 @@ public static MapsAccountPatch MapsAccountPatch(IDictionary tags provisioningState, linkedResources?.ToList(), corsRulesValue != null ? new CorsRules(corsRulesValue?.ToList(), serializedAdditionalRawData: null) : null, + encryption, serializedAdditionalRawData: null); } /// Initializes a new instance of . - /// The Map account key to use for signing. + /// The Map account key to use for signing. Picking `primaryKey` or `secondaryKey` will use the Map account Shared Keys, and using `managedIdentity` will use the auto-renewed private key to sign the SAS. /// The principal Id also known as the object Id of a User Assigned Managed Identity currently assigned to the Map Account. To assign a Managed Identity of the account, use operation Create or Update an assign a User Assigned Identity resource Id. /// Optional, allows control of which region locations are permitted access to Azure Maps REST APIs with the SAS token. Example: "eastus", "westus2". Omitting this parameter will allow all region locations to be accessible. /// Required parameter which represents the desired maximum request per second to allowed for the given SAS token. This does not guarantee perfect accuracy in measurements but provides application safe guards of abuse with eventual enforcement. - /// The date time offset of when the token validity begins. For example "2017-05-24T10:42:03.1567373Z". - /// The date time offset of when the token validity expires. For example "2017-05-24T10:42:03.1567373Z". + /// The date time offset of when the token validity begins. For example "2017-05-24T10:42:03.1567373Z". Maximum duration allowed is 24 hours between `start` and `expiry`. + /// The date time offset of when the token validity expires. For example "2017-05-24T10:42:03.1567373Z". Maximum duration allowed is 24 hours between `start` and `expiry`. /// A new instance for mocking. public static MapsAccountSasContent MapsAccountSasContent(MapsSigningKey signingKey = default, string principalId = null, IEnumerable regions = null, int maxRatePerSecond = default, string start = null, string expiry = null) { diff --git a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Extensions/MapsExtensions.cs b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Extensions/MapsExtensions.cs index 91ddcbeb4178..f197ae47f80f 100644 --- a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Extensions/MapsExtensions.cs +++ b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Extensions/MapsExtensions.cs @@ -100,7 +100,7 @@ public static MapsAccountCollection GetMapsAccounts(this ResourceGroupResource r /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -138,7 +138,7 @@ public static async Task> GetMapsAccountAsync(this /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -176,7 +176,7 @@ public static Response GetMapsAccount(this ResourceGroupRes /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -212,7 +212,7 @@ public static AsyncPageable GetMapsAccountsAsync(this Subsc /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource diff --git a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Extensions/MockableMapsResourceGroupResource.cs b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Extensions/MockableMapsResourceGroupResource.cs index 3187f40e6753..f14ec76a89ae 100644 --- a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Extensions/MockableMapsResourceGroupResource.cs +++ b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Extensions/MockableMapsResourceGroupResource.cs @@ -53,7 +53,7 @@ public virtual MapsAccountCollection GetMapsAccounts() /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -84,7 +84,7 @@ public virtual async Task> GetMapsAccountAsync(str /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource diff --git a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Extensions/MockableMapsSubscriptionResource.cs b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Extensions/MockableMapsSubscriptionResource.cs index 31dc2da70e4b..9c7e649c2839 100644 --- a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Extensions/MockableMapsSubscriptionResource.cs +++ b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Extensions/MockableMapsSubscriptionResource.cs @@ -52,7 +52,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -82,7 +82,7 @@ public virtual AsyncPageable GetMapsAccountsAsync(Cancellat /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource diff --git a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/MapsAccountCollection.cs b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/MapsAccountCollection.cs index 48cc65c96faf..c83866e66520 100644 --- a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/MapsAccountCollection.cs +++ b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/MapsAccountCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task> CreateOrUpdateAsync /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUn /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAsync(string account /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -257,7 +257,7 @@ public virtual Response Get(string accountName, Cancellatio /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -287,7 +287,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToken /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -317,7 +317,7 @@ public virtual Pageable GetAll(CancellationToken cancellati /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -360,7 +360,7 @@ public virtual async Task> ExistsAsync(string accountName, Cancel /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -403,7 +403,7 @@ public virtual Response Exists(string accountName, CancellationToken cance /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -448,7 +448,7 @@ public virtual async Task> GetIfExistsAsyn /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource diff --git a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/MapsAccountData.cs b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/MapsAccountData.cs index b77633b044cb..b3fbfd4829f7 100644 --- a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/MapsAccountData.cs +++ b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/MapsAccountData.cs @@ -71,7 +71,7 @@ public MapsAccountData(AzureLocation location, MapsSku sku) : base(location) /// The location. /// The SKU of this account. /// Get or Set Kind property. - /// Sets the identity property for maps account. + /// Managed service identity (system assigned and/or user assigned identities). /// The map account properties. /// Keeps track of any properties unknown to the library. internal MapsAccountData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, MapsSku sku, MapsAccountKind? kind, ManagedServiceIdentity identity, MapsAccountProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) @@ -92,7 +92,7 @@ internal MapsAccountData() public MapsSku Sku { get; set; } /// Get or Set Kind property. public MapsAccountKind? Kind { get; set; } - /// Sets the identity property for maps account. + /// Managed service identity (system assigned and/or user assigned identities). public ManagedServiceIdentity Identity { get; set; } /// The map account properties. public MapsAccountProperties Properties { get; set; } diff --git a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/MapsAccountResource.cs b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/MapsAccountResource.cs index c8759a206da2..970c3abba30c 100644 --- a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/MapsAccountResource.cs +++ b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/MapsAccountResource.cs @@ -110,7 +110,7 @@ public virtual MapsCreatorCollection GetMapsCreators() /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetMapsCreatorAsync(str /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -172,7 +172,7 @@ public virtual Response GetMapsCreator(string creatorName, /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAsync(CancellationTo /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(CancellationToken cancellationT /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -296,7 +296,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -340,7 +340,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -382,7 +382,7 @@ public virtual async Task> UpdateAsync(MapsAccount /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -428,7 +428,7 @@ public virtual Response Update(MapsAccountPatch patch, Canc /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -474,7 +474,7 @@ public virtual async Task> GetSasAsync(MapsAccount /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -516,7 +516,7 @@ public virtual Response GetSas(MapsAccountSasContent conten /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -554,7 +554,7 @@ public virtual async Task> GetKeysAsync(CancellationTo /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -592,7 +592,7 @@ public virtual Response GetKeys(CancellationToken cancellationT /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -634,7 +634,7 @@ public virtual async Task> RegenerateKeysAsync(MapsKey /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -676,7 +676,7 @@ public virtual Response RegenerateKeys(MapsKeySpecification key /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -738,7 +738,7 @@ public virtual async Task> AddTagAsync(string key, /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -800,7 +800,7 @@ public virtual Response AddTag(string key, string value, Ca /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -857,7 +857,7 @@ public virtual async Task> SetTagsAsync(IDictionar /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -914,7 +914,7 @@ public virtual Response SetTags(IDictionary /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -974,7 +974,7 @@ public virtual async Task> RemoveTagAsync(string k /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource diff --git a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/MapsCreatorCollection.cs b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/MapsCreatorCollection.cs index c083a06bcc26..22ed9da47ff0 100644 --- a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/MapsCreatorCollection.cs +++ b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/MapsCreatorCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -115,7 +115,7 @@ public virtual async Task> CreateOrUpdateAsync /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -166,7 +166,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUn /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -211,7 +211,7 @@ public virtual async Task> GetAsync(string creator /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -256,7 +256,7 @@ public virtual Response Get(string creatorName, Cancellatio /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -286,7 +286,7 @@ public virtual AsyncPageable GetAllAsync(CancellationToken /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -316,7 +316,7 @@ public virtual Pageable GetAll(CancellationToken cancellati /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual async Task> ExistsAsync(string creatorName, Cancel /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -402,7 +402,7 @@ public virtual Response Exists(string creatorName, CancellationToken cance /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -447,7 +447,7 @@ public virtual async Task> GetIfExistsAsyn /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource diff --git a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/MapsCreatorResource.cs b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/MapsCreatorResource.cs index 855b96c1c623..32ebf97691bb 100644 --- a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/MapsCreatorResource.cs +++ b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/MapsCreatorResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsync(CancellationTo /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationToken cancellationT /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -227,7 +227,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -271,7 +271,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task> UpdateAsync(MapsCreator /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -355,7 +355,7 @@ public virtual Response Update(MapsCreatorPatch patch, Canc /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -417,7 +417,7 @@ public virtual async Task> AddTagAsync(string key, /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -479,7 +479,7 @@ public virtual Response AddTag(string key, string value, Ca /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -536,7 +536,7 @@ public virtual async Task> SetTagsAsync(IDictionar /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -593,7 +593,7 @@ public virtual Response SetTags(IDictionary /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource @@ -653,7 +653,7 @@ public virtual async Task> RemoveTagAsync(string k /// /// /// Default Api Version - /// 2021-12-01-preview + /// 2023-06-01 /// /// /// Resource diff --git a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/CustomerManagedKeyEncryption.Serialization.cs b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/CustomerManagedKeyEncryption.Serialization.cs new file mode 100644 index 000000000000..82fbf56c55d1 --- /dev/null +++ b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/CustomerManagedKeyEncryption.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Maps.Models +{ + public partial class CustomerManagedKeyEncryption : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomerManagedKeyEncryption)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(KeyEncryptionKeyIdentity)) + { + writer.WritePropertyName("keyEncryptionKeyIdentity"u8); + writer.WriteObjectValue(KeyEncryptionKeyIdentity, options); + } + if (Optional.IsDefined(KeyEncryptionKeyUri)) + { + writer.WritePropertyName("keyEncryptionKeyUrl"u8); + writer.WriteStringValue(KeyEncryptionKeyUri.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CustomerManagedKeyEncryption IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomerManagedKeyEncryption)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomerManagedKeyEncryption(document.RootElement, options); + } + + internal static CustomerManagedKeyEncryption DeserializeCustomerManagedKeyEncryption(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CustomerManagedKeyEncryptionKeyIdentity keyEncryptionKeyIdentity = default; + Uri keyEncryptionKeyUrl = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("keyEncryptionKeyIdentity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + keyEncryptionKeyIdentity = CustomerManagedKeyEncryptionKeyIdentity.DeserializeCustomerManagedKeyEncryptionKeyIdentity(property.Value, options); + continue; + } + if (property.NameEquals("keyEncryptionKeyUrl"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + keyEncryptionKeyUrl = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomerManagedKeyEncryption(keyEncryptionKeyIdentity, keyEncryptionKeyUrl, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CustomerManagedKeyEncryption)} does not support writing '{options.Format}' format."); + } + } + + CustomerManagedKeyEncryption IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCustomerManagedKeyEncryption(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomerManagedKeyEncryption)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/CustomerManagedKeyEncryption.cs b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/CustomerManagedKeyEncryption.cs new file mode 100644 index 000000000000..65cf18220f0c --- /dev/null +++ b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/CustomerManagedKeyEncryption.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Maps.Models +{ + /// All Customer-managed key encryption properties for the resource. + public partial class CustomerManagedKeyEncryption + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public CustomerManagedKeyEncryption() + { + } + + /// Initializes a new instance of . + /// All identity configuration for Customer-managed key settings defining which identity should be used to auth to Key Vault. + /// key encryption key Url, versioned or non-versioned. Ex: https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78 or https://contosovault.vault.azure.net/keys/contosokek. + /// Keeps track of any properties unknown to the library. + internal CustomerManagedKeyEncryption(CustomerManagedKeyEncryptionKeyIdentity keyEncryptionKeyIdentity, Uri keyEncryptionKeyUri, IDictionary serializedAdditionalRawData) + { + KeyEncryptionKeyIdentity = keyEncryptionKeyIdentity; + KeyEncryptionKeyUri = keyEncryptionKeyUri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// All identity configuration for Customer-managed key settings defining which identity should be used to auth to Key Vault. + public CustomerManagedKeyEncryptionKeyIdentity KeyEncryptionKeyIdentity { get; set; } + /// key encryption key Url, versioned or non-versioned. Ex: https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78 or https://contosovault.vault.azure.net/keys/contosokek. + public Uri KeyEncryptionKeyUri { get; set; } + } +} diff --git a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/CustomerManagedKeyEncryptionKeyIdentity.Serialization.cs b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/CustomerManagedKeyEncryptionKeyIdentity.Serialization.cs new file mode 100644 index 000000000000..c4a5b6e6885a --- /dev/null +++ b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/CustomerManagedKeyEncryptionKeyIdentity.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Maps.Models +{ + public partial class CustomerManagedKeyEncryptionKeyIdentity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomerManagedKeyEncryptionKeyIdentity)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(IdentityType)) + { + writer.WritePropertyName("identityType"u8); + writer.WriteStringValue(IdentityType.Value.ToString()); + } + if (Optional.IsDefined(UserAssignedIdentityResourceId)) + { + writer.WritePropertyName("userAssignedIdentityResourceId"u8); + writer.WriteStringValue(UserAssignedIdentityResourceId); + } + if (Optional.IsDefined(DelegatedIdentityClientId)) + { + writer.WritePropertyName("delegatedIdentityClientId"u8); + writer.WriteStringValue(DelegatedIdentityClientId.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CustomerManagedKeyEncryptionKeyIdentity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CustomerManagedKeyEncryptionKeyIdentity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCustomerManagedKeyEncryptionKeyIdentity(document.RootElement, options); + } + + internal static CustomerManagedKeyEncryptionKeyIdentity DeserializeCustomerManagedKeyEncryptionKeyIdentity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IdentityType? identityType = default; + ResourceIdentifier userAssignedIdentityResourceId = default; + Guid? delegatedIdentityClientId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("identityType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identityType = new IdentityType(property.Value.GetString()); + continue; + } + if (property.NameEquals("userAssignedIdentityResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + userAssignedIdentityResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("delegatedIdentityClientId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + delegatedIdentityClientId = property.Value.GetGuid(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CustomerManagedKeyEncryptionKeyIdentity(identityType, userAssignedIdentityResourceId, delegatedIdentityClientId, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(CustomerManagedKeyEncryptionKeyIdentity)} does not support writing '{options.Format}' format."); + } + } + + CustomerManagedKeyEncryptionKeyIdentity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeCustomerManagedKeyEncryptionKeyIdentity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CustomerManagedKeyEncryptionKeyIdentity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/CustomerManagedKeyEncryptionKeyIdentity.cs b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/CustomerManagedKeyEncryptionKeyIdentity.cs new file mode 100644 index 000000000000..6c85bf014463 --- /dev/null +++ b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/CustomerManagedKeyEncryptionKeyIdentity.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.Maps.Models +{ + /// All identity configuration for Customer-managed key settings defining which identity should be used to auth to Key Vault. + public partial class CustomerManagedKeyEncryptionKeyIdentity + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public CustomerManagedKeyEncryptionKeyIdentity() + { + } + + /// Initializes a new instance of . + /// Values can be systemAssignedIdentity or userAssignedIdentity. + /// user assigned identity to use for accessing key encryption key Url. Ex: /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/<resource group>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. Mutually exclusive with identityType systemAssignedIdentity and delegatedResourceIdentity. + /// delegated identity to use for accessing key encryption key Url. Ex: /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/<resource group>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. Mutually exclusive with identityType systemAssignedIdentity and userAssignedIdentity - internal use only. + /// Keeps track of any properties unknown to the library. + internal CustomerManagedKeyEncryptionKeyIdentity(IdentityType? identityType, ResourceIdentifier userAssignedIdentityResourceId, Guid? delegatedIdentityClientId, IDictionary serializedAdditionalRawData) + { + IdentityType = identityType; + UserAssignedIdentityResourceId = userAssignedIdentityResourceId; + DelegatedIdentityClientId = delegatedIdentityClientId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Values can be systemAssignedIdentity or userAssignedIdentity. + public IdentityType? IdentityType { get; set; } + /// user assigned identity to use for accessing key encryption key Url. Ex: /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/<resource group>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. Mutually exclusive with identityType systemAssignedIdentity and delegatedResourceIdentity. + public ResourceIdentifier UserAssignedIdentityResourceId { get; set; } + /// delegated identity to use for accessing key encryption key Url. Ex: /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/<resource group>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. Mutually exclusive with identityType systemAssignedIdentity and userAssignedIdentity - internal use only. + public Guid? DelegatedIdentityClientId { get; set; } + } +} diff --git a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/Encryption.Serialization.cs b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/Encryption.Serialization.cs new file mode 100644 index 000000000000..cbdfe9180b49 --- /dev/null +++ b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/Encryption.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Maps.Models +{ + public partial class Encryption : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Encryption)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(InfrastructureEncryption)) + { + writer.WritePropertyName("infrastructureEncryption"u8); + writer.WriteStringValue(InfrastructureEncryption.Value.ToString()); + } + if (Optional.IsDefined(CustomerManagedKeyEncryption)) + { + writer.WritePropertyName("customerManagedKeyEncryption"u8); + writer.WriteObjectValue(CustomerManagedKeyEncryption, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + Encryption IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Encryption)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEncryption(document.RootElement, options); + } + + internal static Encryption DeserializeEncryption(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + InfrastructureEncryption? infrastructureEncryption = default; + CustomerManagedKeyEncryption customerManagedKeyEncryption = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("infrastructureEncryption"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + infrastructureEncryption = new InfrastructureEncryption(property.Value.GetString()); + continue; + } + if (property.NameEquals("customerManagedKeyEncryption"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customerManagedKeyEncryption = CustomerManagedKeyEncryption.DeserializeCustomerManagedKeyEncryption(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Encryption(infrastructureEncryption, customerManagedKeyEncryption, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(Encryption)} does not support writing '{options.Format}' format."); + } + } + + Encryption IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data); + return DeserializeEncryption(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Encryption)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/Encryption.cs b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/Encryption.cs new file mode 100644 index 000000000000..e8dbb65c7d37 --- /dev/null +++ b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/Encryption.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Maps.Models +{ + /// (Optional) Discouraged to include in resource definition. Only needed where it is possible to disable platform (AKA infrastructure) encryption. Azure SQL TDE is an example of this. Values are enabled and disabled. + public partial class Encryption + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public Encryption() + { + } + + /// Initializes a new instance of . + /// Values are enabled and disabled. + /// All Customer-managed key encryption properties for the resource. + /// Keeps track of any properties unknown to the library. + internal Encryption(InfrastructureEncryption? infrastructureEncryption, CustomerManagedKeyEncryption customerManagedKeyEncryption, IDictionary serializedAdditionalRawData) + { + InfrastructureEncryption = infrastructureEncryption; + CustomerManagedKeyEncryption = customerManagedKeyEncryption; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Values are enabled and disabled. + public InfrastructureEncryption? InfrastructureEncryption { get; set; } + /// All Customer-managed key encryption properties for the resource. + public CustomerManagedKeyEncryption CustomerManagedKeyEncryption { get; set; } + } +} diff --git a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/IdentityType.cs b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/IdentityType.cs new file mode 100644 index 000000000000..b133bcb6c352 --- /dev/null +++ b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/IdentityType.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Maps.Models +{ + /// Values can be systemAssignedIdentity or userAssignedIdentity. + public readonly partial struct IdentityType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public IdentityType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SystemAssignedIdentityValue = "systemAssignedIdentity"; + private const string UserAssignedIdentityValue = "userAssignedIdentity"; + private const string DelegatedResourceIdentityValue = "delegatedResourceIdentity"; + + /// systemAssignedIdentity. + public static IdentityType SystemAssignedIdentity { get; } = new IdentityType(SystemAssignedIdentityValue); + /// userAssignedIdentity. + public static IdentityType UserAssignedIdentity { get; } = new IdentityType(UserAssignedIdentityValue); + /// delegatedResourceIdentity. + public static IdentityType DelegatedResourceIdentity { get; } = new IdentityType(DelegatedResourceIdentityValue); + /// Determines if two values are the same. + public static bool operator ==(IdentityType left, IdentityType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(IdentityType left, IdentityType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator IdentityType(string value) => new IdentityType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is IdentityType other && Equals(other); + /// + public bool Equals(IdentityType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/InfrastructureEncryption.cs b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/InfrastructureEncryption.cs new file mode 100644 index 000000000000..7b10291aae67 --- /dev/null +++ b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/InfrastructureEncryption.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Maps.Models +{ + /// Values are enabled and disabled. + public readonly partial struct InfrastructureEncryption : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public InfrastructureEncryption(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnabledValue = "enabled"; + private const string DisabledValue = "disabled"; + + /// enabled. + public static InfrastructureEncryption Enabled { get; } = new InfrastructureEncryption(EnabledValue); + /// disabled. + public static InfrastructureEncryption Disabled { get; } = new InfrastructureEncryption(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(InfrastructureEncryption left, InfrastructureEncryption right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(InfrastructureEncryption left, InfrastructureEncryption right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator InfrastructureEncryption(string value) => new InfrastructureEncryption(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is InfrastructureEncryption other && Equals(other); + /// + public bool Equals(InfrastructureEncryption other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/MapsAccountPatch.Serialization.cs b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/MapsAccountPatch.Serialization.cs index 5b4dbd00c168..b0e664fd3ac7 100644 --- a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/MapsAccountPatch.Serialization.cs +++ b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/MapsAccountPatch.Serialization.cs @@ -93,6 +93,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("cors"u8); writer.WriteObjectValue(Cors, options); } + if (Optional.IsDefined(Encryption)) + { + writer.WritePropertyName("encryption"u8); + writer.WriteObjectValue(Encryption, options); + } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -140,6 +145,7 @@ internal static MapsAccountPatch DeserializeMapsAccountPatch(JsonElement element string provisioningState = default; IList linkedResources = default; CorsRules cors = default; + Encryption encryption = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -240,6 +246,15 @@ internal static MapsAccountPatch DeserializeMapsAccountPatch(JsonElement element cors = CorsRules.DeserializeCorsRules(property0.Value, options); continue; } + if (property0.NameEquals("encryption"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + encryption = Encryption.DeserializeEncryption(property0.Value, options); + continue; + } } continue; } @@ -259,6 +274,7 @@ internal static MapsAccountPatch DeserializeMapsAccountPatch(JsonElement element provisioningState, linkedResources ?? new ChangeTrackingList(), cors, + encryption, serializedAdditionalRawData); } diff --git a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/MapsAccountPatch.cs b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/MapsAccountPatch.cs index d52936ee75e6..fc6c536d7a1a 100644 --- a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/MapsAccountPatch.cs +++ b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/MapsAccountPatch.cs @@ -57,14 +57,15 @@ public MapsAccountPatch() /// Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters and value no greater than 256 characters. /// Get or Set Kind property. /// The SKU of this account. - /// Sets the identity property for maps account. + /// Managed service identity (system assigned and/or user assigned identities). /// A unique identifier for the maps account. - /// Allows toggle functionality on Azure Policy to disable Azure Maps local authentication support. This will disable Shared Keys authentication from any usage. - /// The provisioning state of the Map account resource. - /// Sets the resources to be used for Managed Identities based operations for the Map account resource. + /// Allows toggle functionality on Azure Policy to disable Azure Maps local authentication support. This will disable Shared Keys and Shared Access Signature Token authentication from any usage. + /// The provisioning state of the Map account resource, Account updates can only be performed on terminal states. Terminal states: `Succeeded` and `Failed`. + /// The array of associated resources to the Map account. Linked resource in the array cannot individually update, you must update all linked resources in the array together. These resources may be used on operations on the Azure Maps REST API. Access is controlled by the Map Account Managed Identity(s) permissions to those resource(s). /// Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Blob service. + /// (Optional) Discouraged to include in resource definition. Only needed where it is possible to disable platform (AKA infrastructure) encryption. Azure SQL TDE is an example of this. Values are enabled and disabled. /// Keeps track of any properties unknown to the library. - internal MapsAccountPatch(IDictionary tags, MapsAccountKind? kind, MapsSku sku, ManagedServiceIdentity identity, Guid? uniqueId, bool? disableLocalAuth, string provisioningState, IList linkedResources, CorsRules cors, IDictionary serializedAdditionalRawData) + internal MapsAccountPatch(IDictionary tags, MapsAccountKind? kind, MapsSku sku, ManagedServiceIdentity identity, Guid? uniqueId, bool? disableLocalAuth, string provisioningState, IList linkedResources, CorsRules cors, Encryption encryption, IDictionary serializedAdditionalRawData) { Tags = tags; Kind = kind; @@ -75,6 +76,7 @@ internal MapsAccountPatch(IDictionary tags, MapsAccountKind? kin ProvisioningState = provisioningState; LinkedResources = linkedResources; Cors = cors; + Encryption = encryption; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -84,15 +86,15 @@ internal MapsAccountPatch(IDictionary tags, MapsAccountKind? kin public MapsAccountKind? Kind { get; set; } /// The SKU of this account. public MapsSku Sku { get; set; } - /// Sets the identity property for maps account. + /// Managed service identity (system assigned and/or user assigned identities). public ManagedServiceIdentity Identity { get; set; } /// A unique identifier for the maps account. public Guid? UniqueId { get; } - /// Allows toggle functionality on Azure Policy to disable Azure Maps local authentication support. This will disable Shared Keys authentication from any usage. + /// Allows toggle functionality on Azure Policy to disable Azure Maps local authentication support. This will disable Shared Keys and Shared Access Signature Token authentication from any usage. public bool? DisableLocalAuth { get; set; } - /// The provisioning state of the Map account resource. + /// The provisioning state of the Map account resource, Account updates can only be performed on terminal states. Terminal states: `Succeeded` and `Failed`. public string ProvisioningState { get; } - /// Sets the resources to be used for Managed Identities based operations for the Map account resource. + /// The array of associated resources to the Map account. Linked resource in the array cannot individually update, you must update all linked resources in the array together. These resources may be used on operations on the Azure Maps REST API. Access is controlled by the Map Account Managed Identity(s) permissions to those resource(s). public IList LinkedResources { get; } /// Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Blob service. internal CorsRules Cors { get; set; } @@ -106,5 +108,8 @@ public IList CorsRulesValue return Cors.CorsRulesValue; } } + + /// (Optional) Discouraged to include in resource definition. Only needed where it is possible to disable platform (AKA infrastructure) encryption. Azure SQL TDE is an example of this. Values are enabled and disabled. + public Encryption Encryption { get; set; } } } diff --git a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/MapsAccountProperties.Serialization.cs b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/MapsAccountProperties.Serialization.cs index 1ae280d46034..52a925285056 100644 --- a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/MapsAccountProperties.Serialization.cs +++ b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/MapsAccountProperties.Serialization.cs @@ -64,6 +64,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("cors"u8); writer.WriteObjectValue(Cors, options); } + if (Optional.IsDefined(Encryption)) + { + writer.WritePropertyName("encryption"u8); + writer.WriteObjectValue(Encryption, options); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -106,6 +111,7 @@ internal static MapsAccountProperties DeserializeMapsAccountProperties(JsonEleme string provisioningState = default; IList linkedResources = default; CorsRules cors = default; + Encryption encryption = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -156,6 +162,15 @@ internal static MapsAccountProperties DeserializeMapsAccountProperties(JsonEleme cors = CorsRules.DeserializeCorsRules(property.Value, options); continue; } + if (property.NameEquals("encryption"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + encryption = Encryption.DeserializeEncryption(property.Value, options); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -168,6 +183,7 @@ internal static MapsAccountProperties DeserializeMapsAccountProperties(JsonEleme provisioningState, linkedResources ?? new ChangeTrackingList(), cors, + encryption, serializedAdditionalRawData); } diff --git a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/MapsAccountProperties.cs b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/MapsAccountProperties.cs index c160503d6c51..8a76d5695fae 100644 --- a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/MapsAccountProperties.cs +++ b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/MapsAccountProperties.cs @@ -53,28 +53,30 @@ public MapsAccountProperties() /// Initializes a new instance of . /// A unique identifier for the maps account. - /// Allows toggle functionality on Azure Policy to disable Azure Maps local authentication support. This will disable Shared Keys authentication from any usage. - /// The provisioning state of the Map account resource. - /// Sets the resources to be used for Managed Identities based operations for the Map account resource. + /// Allows toggle functionality on Azure Policy to disable Azure Maps local authentication support. This will disable Shared Keys and Shared Access Signature Token authentication from any usage. + /// The provisioning state of the Map account resource, Account updates can only be performed on terminal states. Terminal states: `Succeeded` and `Failed`. + /// The array of associated resources to the Map account. Linked resource in the array cannot individually update, you must update all linked resources in the array together. These resources may be used on operations on the Azure Maps REST API. Access is controlled by the Map Account Managed Identity(s) permissions to those resource(s). /// Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Blob service. + /// (Optional) Discouraged to include in resource definition. Only needed where it is possible to disable platform (AKA infrastructure) encryption. Azure SQL TDE is an example of this. Values are enabled and disabled. /// Keeps track of any properties unknown to the library. - internal MapsAccountProperties(Guid? uniqueId, bool? disableLocalAuth, string provisioningState, IList linkedResources, CorsRules cors, IDictionary serializedAdditionalRawData) + internal MapsAccountProperties(Guid? uniqueId, bool? disableLocalAuth, string provisioningState, IList linkedResources, CorsRules cors, Encryption encryption, IDictionary serializedAdditionalRawData) { UniqueId = uniqueId; DisableLocalAuth = disableLocalAuth; ProvisioningState = provisioningState; LinkedResources = linkedResources; Cors = cors; + Encryption = encryption; _serializedAdditionalRawData = serializedAdditionalRawData; } /// A unique identifier for the maps account. public Guid? UniqueId { get; } - /// Allows toggle functionality on Azure Policy to disable Azure Maps local authentication support. This will disable Shared Keys authentication from any usage. + /// Allows toggle functionality on Azure Policy to disable Azure Maps local authentication support. This will disable Shared Keys and Shared Access Signature Token authentication from any usage. public bool? DisableLocalAuth { get; set; } - /// The provisioning state of the Map account resource. + /// The provisioning state of the Map account resource, Account updates can only be performed on terminal states. Terminal states: `Succeeded` and `Failed`. public string ProvisioningState { get; } - /// Sets the resources to be used for Managed Identities based operations for the Map account resource. + /// The array of associated resources to the Map account. Linked resource in the array cannot individually update, you must update all linked resources in the array together. These resources may be used on operations on the Azure Maps REST API. Access is controlled by the Map Account Managed Identity(s) permissions to those resource(s). public IList LinkedResources { get; } /// Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Blob service. internal CorsRules Cors { get; set; } @@ -88,5 +90,8 @@ public IList CorsRulesValue return Cors.CorsRulesValue; } } + + /// (Optional) Discouraged to include in resource definition. Only needed where it is possible to disable platform (AKA infrastructure) encryption. Azure SQL TDE is an example of this. Values are enabled and disabled. + public Encryption Encryption { get; set; } } } diff --git a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/MapsAccountSasContent.cs b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/MapsAccountSasContent.cs index bba4c53bfeb6..a405c73db2f8 100644 --- a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/MapsAccountSasContent.cs +++ b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/MapsAccountSasContent.cs @@ -46,11 +46,11 @@ public partial class MapsAccountSasContent private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The Map account key to use for signing. + /// The Map account key to use for signing. Picking `primaryKey` or `secondaryKey` will use the Map account Shared Keys, and using `managedIdentity` will use the auto-renewed private key to sign the SAS. /// The principal Id also known as the object Id of a User Assigned Managed Identity currently assigned to the Map Account. To assign a Managed Identity of the account, use operation Create or Update an assign a User Assigned Identity resource Id. /// Required parameter which represents the desired maximum request per second to allowed for the given SAS token. This does not guarantee perfect accuracy in measurements but provides application safe guards of abuse with eventual enforcement. - /// The date time offset of when the token validity begins. For example "2017-05-24T10:42:03.1567373Z". - /// The date time offset of when the token validity expires. For example "2017-05-24T10:42:03.1567373Z". + /// The date time offset of when the token validity begins. For example "2017-05-24T10:42:03.1567373Z". Maximum duration allowed is 24 hours between `start` and `expiry`. + /// The date time offset of when the token validity expires. For example "2017-05-24T10:42:03.1567373Z". Maximum duration allowed is 24 hours between `start` and `expiry`. /// , or is null. public MapsAccountSasContent(MapsSigningKey signingKey, string principalId, int maxRatePerSecond, string start, string expiry) { @@ -67,12 +67,12 @@ public MapsAccountSasContent(MapsSigningKey signingKey, string principalId, int } /// Initializes a new instance of . - /// The Map account key to use for signing. + /// The Map account key to use for signing. Picking `primaryKey` or `secondaryKey` will use the Map account Shared Keys, and using `managedIdentity` will use the auto-renewed private key to sign the SAS. /// The principal Id also known as the object Id of a User Assigned Managed Identity currently assigned to the Map Account. To assign a Managed Identity of the account, use operation Create or Update an assign a User Assigned Identity resource Id. /// Optional, allows control of which region locations are permitted access to Azure Maps REST APIs with the SAS token. Example: "eastus", "westus2". Omitting this parameter will allow all region locations to be accessible. /// Required parameter which represents the desired maximum request per second to allowed for the given SAS token. This does not guarantee perfect accuracy in measurements but provides application safe guards of abuse with eventual enforcement. - /// The date time offset of when the token validity begins. For example "2017-05-24T10:42:03.1567373Z". - /// The date time offset of when the token validity expires. For example "2017-05-24T10:42:03.1567373Z". + /// The date time offset of when the token validity begins. For example "2017-05-24T10:42:03.1567373Z". Maximum duration allowed is 24 hours between `start` and `expiry`. + /// The date time offset of when the token validity expires. For example "2017-05-24T10:42:03.1567373Z". Maximum duration allowed is 24 hours between `start` and `expiry`. /// Keeps track of any properties unknown to the library. internal MapsAccountSasContent(MapsSigningKey signingKey, string principalId, IList regions, int maxRatePerSecond, string start, string expiry, IDictionary serializedAdditionalRawData) { @@ -90,7 +90,7 @@ internal MapsAccountSasContent() { } - /// The Map account key to use for signing. + /// The Map account key to use for signing. Picking `primaryKey` or `secondaryKey` will use the Map account Shared Keys, and using `managedIdentity` will use the auto-renewed private key to sign the SAS. public MapsSigningKey SigningKey { get; } /// The principal Id also known as the object Id of a User Assigned Managed Identity currently assigned to the Map Account. To assign a Managed Identity of the account, use operation Create or Update an assign a User Assigned Identity resource Id. public string PrincipalId { get; } @@ -98,9 +98,9 @@ internal MapsAccountSasContent() public IList Regions { get; } /// Required parameter which represents the desired maximum request per second to allowed for the given SAS token. This does not guarantee perfect accuracy in measurements but provides application safe guards of abuse with eventual enforcement. public int MaxRatePerSecond { get; } - /// The date time offset of when the token validity begins. For example "2017-05-24T10:42:03.1567373Z". + /// The date time offset of when the token validity begins. For example "2017-05-24T10:42:03.1567373Z". Maximum duration allowed is 24 hours between `start` and `expiry`. public string Start { get; } - /// The date time offset of when the token validity expires. For example "2017-05-24T10:42:03.1567373Z". + /// The date time offset of when the token validity expires. For example "2017-05-24T10:42:03.1567373Z". Maximum duration allowed is 24 hours between `start` and `expiry`. public string Expiry { get; } } } diff --git a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/MapsSigningKey.cs b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/MapsSigningKey.cs index bb9f0de26486..5bd809acb3a5 100644 --- a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/MapsSigningKey.cs +++ b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/Models/MapsSigningKey.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.Maps.Models { - /// The Map account key to use for signing. + /// The Map account key to use for signing. Picking `primaryKey` or `secondaryKey` will use the Map account Shared Keys, and using `managedIdentity` will use the auto-renewed private key to sign the SAS. public readonly partial struct MapsSigningKey : IEquatable { private readonly string _value; @@ -24,11 +24,14 @@ public MapsSigningKey(string value) private const string PrimaryKeyValue = "primaryKey"; private const string SecondaryKeyValue = "secondaryKey"; + private const string ManagedIdentityValue = "managedIdentity"; /// primaryKey. public static MapsSigningKey PrimaryKey { get; } = new MapsSigningKey(PrimaryKeyValue); /// secondaryKey. public static MapsSigningKey SecondaryKey { get; } = new MapsSigningKey(SecondaryKeyValue); + /// managedIdentity. + public static MapsSigningKey ManagedIdentity { get; } = new MapsSigningKey(ManagedIdentityValue); /// Determines if two values are the same. public static bool operator ==(MapsSigningKey left, MapsSigningKey right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/RestOperations/AccountsRestOperations.cs b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/RestOperations/AccountsRestOperations.cs index 36fb237ee061..ddbb11cf3150 100644 --- a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/RestOperations/AccountsRestOperations.cs +++ b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/RestOperations/AccountsRestOperations.cs @@ -32,7 +32,7 @@ public AccountsRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-12-01-preview"; + _apiVersion = apiVersion ?? "2023-06-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/RestOperations/CreatorsRestOperations.cs b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/RestOperations/CreatorsRestOperations.cs index 68e9ae933efb..962fa81e9442 100644 --- a/sdk/maps/Azure.ResourceManager.Maps/src/Generated/RestOperations/CreatorsRestOperations.cs +++ b/sdk/maps/Azure.ResourceManager.Maps/src/Generated/RestOperations/CreatorsRestOperations.cs @@ -32,7 +32,7 @@ public CreatorsRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-12-01-preview"; + _apiVersion = apiVersion ?? "2023-06-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/maps/Azure.ResourceManager.Maps/src/autorest.md b/sdk/maps/Azure.ResourceManager.Maps/src/autorest.md index 68502408738b..a9c5f492198f 100644 --- a/sdk/maps/Azure.ResourceManager.Maps/src/autorest.md +++ b/sdk/maps/Azure.ResourceManager.Maps/src/autorest.md @@ -8,7 +8,7 @@ azure-arm: true csharp: true library-name: Maps namespace: Azure.ResourceManager.Maps -require: https://github.com/Azure/azure-rest-api-specs/blob/6b08774c89877269e73e11ac3ecbd1bd4e14f5a0/specification/maps/resource-manager/readme.md +require: https://github.com/Azure/azure-rest-api-specs/blob/d8220a01ae67dedf6f0bbb5deebe941dc7b728d3/specification/maps/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true sample-gen: