From d826839fb2288ee0e30e040606dc0f2173a25c39 Mon Sep 17 00:00:00 2001 From: Yao Tong Date: Sun, 13 Oct 2024 21:47:09 -0400 Subject: [PATCH 01/14] generate code --- ...e_HybridComputeExtensionValueCollection.cs | 8 +- ...ple_HybridComputeExtensionValueResource.cs | 2 +- .../Sample_HybridComputeGatewayCollection.cs | 204 ---- .../Sample_HybridComputeGatewayResource.cs | 147 --- .../Sample_HybridComputeLicenseCollection.cs | 10 +- .../Sample_HybridComputeLicenseResource.cs | 50 +- .../Sample_HybridComputeMachineCollection.cs | 67 +- ...HybridComputeMachineExtensionCollection.cs | 10 +- ...e_HybridComputeMachineExtensionResource.cs | 6 +- .../Sample_HybridComputeMachineResource.cs | 20 +- ...putePrivateEndpointConnectionCollection.cs | 10 +- ...omputePrivateEndpointConnectionResource.cs | 6 +- ...Sample_HybridComputePrivateLinkResource.cs | 2 +- ...ridComputePrivateLinkResourceCollection.cs | 8 +- ...HybridComputePrivateLinkScopeCollection.cs | 12 +- ...e_HybridComputePrivateLinkScopeResource.cs | 10 +- .../Samples/Sample_LicenseProfileResource.cs | 170 ++++ .../Sample_MachineRunCommandCollection.cs | 217 ----- .../Sample_MachineRunCommandResource.cs | 128 --- ...ecurityPerimeterConfigurationCollection.cs | 8 +- ...kSecurityPerimeterConfigurationResource.cs | 32 +- .../Sample_ResourceGroupResourceExtensions.cs | 53 -- .../Generated/ArmHybridComputeModelFactory.cs | 337 +++---- .../Extensions/HybridComputeExtensions.cs | 356 ++----- .../MockableHybridComputeArmClient.cs | 36 +- ...kableHybridComputeResourceGroupResource.cs | 183 +--- ...ckableHybridComputeSubscriptionResource.cs | 164 ++-- .../HybridComputeExtensionValueCollection.cs | 16 +- .../HybridComputeExtensionValueData.cs | 2 +- .../HybridComputeExtensionValueResource.cs | 4 +- .../HybridComputeGatewayCollection.cs | 494 ---------- .../HybridComputeGatewayData.Serialization.cs | 495 ---------- .../src/Generated/HybridComputeGatewayData.cs | 105 -- ...ridComputeGatewayResource.Serialization.cs | 26 - .../Generated/HybridComputeGatewayResource.cs | 699 -------------- .../HybridComputeLicenseCollection.cs | 20 +- .../Generated/HybridComputeLicenseResource.cs | 24 +- .../HybridComputeMachineCollection.cs | 120 ++- ...HybridComputeMachineExtensionCollection.cs | 20 +- .../HybridComputeMachineExtensionResource.cs | 28 +- .../Generated/HybridComputeMachineResource.cs | 124 +-- ...putePrivateEndpointConnectionCollection.cs | 20 +- ...omputePrivateEndpointConnectionResource.cs | 12 +- .../HybridComputePrivateLinkResource.cs | 4 +- ...ridComputePrivateLinkResourceCollection.cs | 16 +- ...HybridComputePrivateLinkScopeCollection.cs | 20 +- .../HybridComputePrivateLinkScopeResource.cs | 36 +- .../LicenseProfileData.Serialization.cs | 896 ++++++++++++++++++ .../src/Generated/LicenseProfileData.cs | 161 ++++ .../LicenseProfileResource.Serialization.cs | 26 + ...dResource.cs => LicenseProfileResource.cs} | 388 +++++--- .../HybridComputeGatewayOperationSource.cs | 38 - .../LicenseProfileOperationSource.cs | 38 + .../MachineRunCommandOperationSource.cs | 38 - ...igurationReconcileResultOperationSource.cs | 30 + .../Generated/MachineRunCommandCollection.cs | 495 ---------- .../MachineRunCommandData.Serialization.cs | 753 --------------- .../src/Generated/MachineRunCommandData.cs | 146 --- ...MachineRunCommandResource.Serialization.cs | 26 - .../ExtensionsResourceStatus.Serialization.cs | 305 ------ .../Models/ExtensionsResourceStatus.cs | 86 -- ...ExtensionsStatusLevelType.Serialization.cs | 30 - .../Models/ExtensionsStatusLevelType.cs | 20 - .../Models/HybridComputeExecutionState.cs | 66 -- ...HybridComputeGatewayPatch.Serialization.cs | 159 ---- .../Models/HybridComputeGatewayPatch.cs | 35 - .../Models/HybridComputeGatewayType.cs | 48 - ...uteTargetResourceSettings.Serialization.cs | 307 ------ .../HybridComputeTargetResourceSettings.cs | 77 -- .../LicenseProfilePatch.Serialization.cs | 267 ++++++ .../Generated/Models/LicenseProfilePatch.cs | 55 ++ .../LicenseProfileSubscriptionStatusUpdate.cs | 51 + ...icenseProfilesListResult.Serialization.cs} | 44 +- ...Result.cs => LicenseProfilesListResult.cs} | 28 +- ...ineRunCommandInstanceView.Serialization.cs | 418 -------- .../Models/MachineRunCommandInstanceView.cs | 102 -- ...ineRunCommandScriptSource.Serialization.cs | 264 ------ .../Models/MachineRunCommandScriptSource.cs | 81 -- ...hineRunCommandsListResult.Serialization.cs | 219 ----- ...igurationReconcileResult.Serialization.cs} | 90 +- ...yPerimeterConfigurationReconcileResult.cs} | 27 +- .../ProductFeatureUpdate.Serialization.cs | 144 +++ ...utParameter.cs => ProductFeatureUpdate.cs} | 39 +- .../RunCommandInputParameter.Serialization.cs | 198 ---- .../Models/RunCommandManagedIdentity.cs | 71 -- ...ecurityPerimeterConfigurationCollection.cs | 16 +- ...kSecurityPerimeterConfigurationResource.cs | 89 +- .../ExtensionMetadataRestOperations.cs | 2 +- .../RestOperations/GatewaysRestOperations.cs | 731 -------------- .../HybridComputeManagementRestOperations.cs | 2 +- ...ns.cs => LicenseProfilesRestOperations.cs} | 300 +++--- .../RestOperations/LicensesRestOperations.cs | 78 +- .../MachineExtensionsRestOperations.cs | 6 +- .../RestOperations/MachinesRestOperations.cs | 112 ++- .../NetworkProfileRestOperations.cs | 2 +- ...tyPerimeterConfigurationsRestOperations.cs | 96 +- ...rivateEndpointConnectionsRestOperations.cs | 2 +- .../PrivateLinkResourcesRestOperations.cs | 2 +- .../PrivateLinkScopesRestOperations.cs | 2 +- .../RestOperations/SettingsRestOperations.cs | 165 ---- .../src/autorest.md | 80 +- .../tests/HybridComputeManagementTestBase.cs | 6 +- 102 files changed, 3569 insertions(+), 8929 deletions(-) delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeGatewayCollection.cs delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeGatewayResource.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_LicenseProfileResource.cs delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_MachineRunCommandCollection.cs delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_MachineRunCommandResource.cs delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeGatewayCollection.cs delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeGatewayData.Serialization.cs delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeGatewayData.cs delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeGatewayResource.Serialization.cs delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeGatewayResource.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LicenseProfileData.Serialization.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LicenseProfileData.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LicenseProfileResource.Serialization.cs rename sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/{MachineRunCommandResource.cs => LicenseProfileResource.cs} (54%) delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/HybridComputeGatewayOperationSource.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/LicenseProfileOperationSource.cs delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/MachineRunCommandOperationSource.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/NetworkSecurityPerimeterConfigurationReconcileResultOperationSource.cs delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandCollection.cs delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandData.Serialization.cs delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandData.cs delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandResource.Serialization.cs delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionsResourceStatus.Serialization.cs delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionsResourceStatus.cs delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionsStatusLevelType.Serialization.cs delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionsStatusLevelType.cs delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeExecutionState.cs delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeGatewayPatch.Serialization.cs delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeGatewayPatch.cs delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeGatewayType.cs delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeTargetResourceSettings.Serialization.cs delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeTargetResourceSettings.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfilePatch.Serialization.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfilePatch.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileSubscriptionStatusUpdate.cs rename sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/{GatewaysListResult.Serialization.cs => LicenseProfilesListResult.Serialization.cs} (74%) rename sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/{GatewaysListResult.cs => LicenseProfilesListResult.cs} (63%) delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandInstanceView.Serialization.cs delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandInstanceView.cs delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandScriptSource.Serialization.cs delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandScriptSource.cs delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandsListResult.Serialization.cs rename sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/{RunCommandManagedIdentity.Serialization.cs => NetworkSecurityPerimeterConfigurationReconcileResult.Serialization.cs} (55%) rename sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/{MachineRunCommandsListResult.cs => NetworkSecurityPerimeterConfigurationReconcileResult.cs} (60%) create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ProductFeatureUpdate.Serialization.cs rename sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/{RunCommandInputParameter.cs => ProductFeatureUpdate.cs} (55%) delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandInputParameter.Serialization.cs delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandManagedIdentity.cs delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/GatewaysRestOperations.cs rename sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/{MachineRunCommandsRestOperations.cs => LicenseProfilesRestOperations.cs} (64%) delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/SettingsRestOperations.cs diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeExtensionValueCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeExtensionValueCollection.cs index 2908a212fe8e0..f8e957faa2516 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeExtensionValueCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeExtensionValueCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_HybridComputeExtensionValueCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GETAnExtensionsMetadata() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/extension/ExtensionMetadata_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/extension/ExtensionMetadata_Get.json // this example is just showing the usage of "ExtensionMetadata_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 @@ -56,7 +56,7 @@ public async Task Get_GETAnExtensionsMetadata() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GETAnExtensionsMetadata() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/extension/ExtensionMetadata_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/extension/ExtensionMetadata_Get.json // this example is just showing the usage of "ExtensionMetadata_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 @@ -88,7 +88,7 @@ public async Task Exists_GETAnExtensionsMetadata() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GETAnExtensionsMetadata() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/extension/ExtensionMetadata_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/extension/ExtensionMetadata_Get.json // this example is just showing the usage of "ExtensionMetadata_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 GetIfExists_GETAnExtensionsMetadata() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GETAListOfExtensions() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/extension/ExtensionMetadata_List.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/extension/ExtensionMetadata_List.json // this example is just showing the usage of "ExtensionMetadata_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeExtensionValueResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeExtensionValueResource.cs index bef2169de97ce..4445bb7ae091c 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeExtensionValueResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeExtensionValueResource.cs @@ -19,7 +19,7 @@ public partial class Sample_HybridComputeExtensionValueResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GETAnExtensionsMetadata() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/extension/ExtensionMetadata_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/extension/ExtensionMetadata_Get.json // this example is just showing the usage of "ExtensionMetadata_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/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeGatewayCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeGatewayCollection.cs deleted file mode 100644 index e254f518b504a..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeGatewayCollection.cs +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.HybridCompute.Models; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.HybridCompute.Samples -{ - public partial class Sample_HybridComputeGatewayCollection - { - // Create or Update a Gateway - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateOrUpdateAGateway() - { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/gateway/Gateway_CreateOrUpdate.json - // this example is just showing the usage of "Gateways_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 = "ffd506c8-3415-42d3-9612-fdb423fb17df"; - string resourceGroupName = "myResourceGroup"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this HybridComputeGatewayResource - HybridComputeGatewayCollection collection = resourceGroupResource.GetHybridComputeGateways(); - - // invoke the operation - string gatewayName = "{gatewayName}"; - HybridComputeGatewayData data = new HybridComputeGatewayData(new AzureLocation("eastus2euap")) - { - GatewayType = HybridComputeGatewayType.Public, - AllowedFeatures = -{ -"*" -}, - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, gatewayName, data); - HybridComputeGatewayResource 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 - HybridComputeGatewayData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Get Gateway - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_GetGateway() - { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/gateway/Gateway_Get.json - // this example is just showing the usage of "Gateways_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "ffd506c8-3415-42d3-9612-fdb423fb17df"; - string resourceGroupName = "myResourceGroup"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this HybridComputeGatewayResource - HybridComputeGatewayCollection collection = resourceGroupResource.GetHybridComputeGateways(); - - // invoke the operation - string gatewayName = "{gatewayName}"; - HybridComputeGatewayResource result = await collection.GetAsync(gatewayName); - - // 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 - HybridComputeGatewayData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Get Gateway - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_GetGateway() - { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/gateway/Gateway_Get.json - // this example is just showing the usage of "Gateways_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "ffd506c8-3415-42d3-9612-fdb423fb17df"; - string resourceGroupName = "myResourceGroup"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this HybridComputeGatewayResource - HybridComputeGatewayCollection collection = resourceGroupResource.GetHybridComputeGateways(); - - // invoke the operation - string gatewayName = "{gatewayName}"; - bool result = await collection.ExistsAsync(gatewayName); - - Console.WriteLine($"Succeeded: {result}"); - } - - // Get Gateway - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_GetGateway() - { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/gateway/Gateway_Get.json - // this example is just showing the usage of "Gateways_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "ffd506c8-3415-42d3-9612-fdb423fb17df"; - string resourceGroupName = "myResourceGroup"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this HybridComputeGatewayResource - HybridComputeGatewayCollection collection = resourceGroupResource.GetHybridComputeGateways(); - - // invoke the operation - string gatewayName = "{gatewayName}"; - NullableResponse response = await collection.GetIfExistsAsync(gatewayName); - HybridComputeGatewayResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine($"Succeeded with null as result"); - } - else - { - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridComputeGatewayData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - - // List Gateways by Resource Group - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_ListGatewaysByResourceGroup() - { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/gateway/Gateway_ListByResourceGroup.json - // this example is just showing the usage of "Gateways_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "ffd506c8-3415-42d3-9612-fdb423fb17df"; - string resourceGroupName = "myResourceGroup"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // get the collection of this HybridComputeGatewayResource - HybridComputeGatewayCollection collection = resourceGroupResource.GetHybridComputeGateways(); - - // invoke the operation and iterate over the result - await foreach (HybridComputeGatewayResource item in collection.GetAllAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridComputeGatewayData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeGatewayResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeGatewayResource.cs deleted file mode 100644 index ebb10583a0e10..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeGatewayResource.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.HybridCompute.Models; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.HybridCompute.Samples -{ - public partial class Sample_HybridComputeGatewayResource - { - // Update a Gateway - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_UpdateAGateway() - { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/gateway/Gateway_Update.json - // this example is just showing the usage of "Gateways_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 HybridComputeGatewayResource created on azure - // for more information of creating HybridComputeGatewayResource, please refer to the document of HybridComputeGatewayResource - string subscriptionId = "ffd506c8-3415-42d3-9612-fdb423fb17df"; - string resourceGroupName = "myResourceGroup"; - string gatewayName = "{gatewayName}"; - ResourceIdentifier hybridComputeGatewayResourceId = HybridComputeGatewayResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, gatewayName); - HybridComputeGatewayResource hybridComputeGateway = client.GetHybridComputeGatewayResource(hybridComputeGatewayResourceId); - - // invoke the operation - HybridComputeGatewayPatch patch = new HybridComputeGatewayPatch() - { - AllowedFeatures = -{ -"*" -}, - }; - HybridComputeGatewayResource result = await hybridComputeGateway.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 - HybridComputeGatewayData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Get Gateway - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_GetGateway() - { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/gateway/Gateway_Get.json - // this example is just showing the usage of "Gateways_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridComputeGatewayResource created on azure - // for more information of creating HybridComputeGatewayResource, please refer to the document of HybridComputeGatewayResource - string subscriptionId = "ffd506c8-3415-42d3-9612-fdb423fb17df"; - string resourceGroupName = "myResourceGroup"; - string gatewayName = "{gatewayName}"; - ResourceIdentifier hybridComputeGatewayResourceId = HybridComputeGatewayResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, gatewayName); - HybridComputeGatewayResource hybridComputeGateway = client.GetHybridComputeGatewayResource(hybridComputeGatewayResourceId); - - // invoke the operation - HybridComputeGatewayResource result = await hybridComputeGateway.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridComputeGatewayData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Delete a Gateway - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Delete_DeleteAGateway() - { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/gateway/Gateway_Delete.json - // this example is just showing the usage of "Gateways_Delete" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridComputeGatewayResource created on azure - // for more information of creating HybridComputeGatewayResource, please refer to the document of HybridComputeGatewayResource - string subscriptionId = "ffd506c8-3415-42d3-9612-fdb423fb17df"; - string resourceGroupName = "myResourceGroup"; - string gatewayName = "{gatewayName}"; - ResourceIdentifier hybridComputeGatewayResourceId = HybridComputeGatewayResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, gatewayName); - HybridComputeGatewayResource hybridComputeGateway = client.GetHybridComputeGatewayResource(hybridComputeGatewayResourceId); - - // invoke the operation - await hybridComputeGateway.DeleteAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - - // List Gateways by Subscription - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetHybridComputeGateways_ListGatewaysBySubscription() - { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/gateway/Gateway_ListBySubscription.json - // this example is just showing the usage of "Gateways_ListBySubscription" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this SubscriptionResource created on azure - // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource - string subscriptionId = "ffd506c8-3415-42d3-9612-fdb423fb17df"; - ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); - SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); - - // invoke the operation and iterate over the result - await foreach (HybridComputeGatewayResource item in subscriptionResource.GetHybridComputeGatewaysAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - HybridComputeGatewayData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeLicenseCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeLicenseCollection.cs index d7eef633c8c70..8df0bc2e04007 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeLicenseCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeLicenseCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_HybridComputeLicenseCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateALicense() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/license/License_CreateOrUpdate.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/license/License_CreateOrUpdate.json // this example is just showing the usage of "Licenses_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 @@ -68,7 +68,7 @@ public async Task CreateOrUpdate_CreateOrUpdateALicense() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetLicense() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/license/License_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/license/License_Get.json // this example is just showing the usage of "Licenses_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -102,7 +102,7 @@ public async Task Get_GetLicense() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetLicense() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/license/License_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/license/License_Get.json // this example is just showing the usage of "Licenses_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 Exists_GetLicense() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetLicense() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/license/License_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/license/License_Get.json // this example is just showing the usage of "Licenses_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 @@ -174,7 +174,7 @@ public async Task GetIfExists_GetLicense() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GETAllMachineExtensions() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/license/License_ListByResourceGroup.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/license/License_ListByResourceGroup.json // this example is just showing the usage of "Licenses_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/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeLicenseResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeLicenseResource.cs index 88669e9d01275..bf021ab01bbb8 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeLicenseResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeLicenseResource.cs @@ -16,12 +16,54 @@ namespace Azure.ResourceManager.HybridCompute.Samples { public partial class Sample_HybridComputeLicenseResource { + // Validate a License + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task ValidateLicenseLicense_ValidateALicense() + { + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/license/License_ValidateLicense.json + // this example is just showing the usage of "Licenses_ValidateLicense" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "{subscriptionId}"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + HybridComputeLicenseData data = new HybridComputeLicenseData(new AzureLocation("eastus2euap")) + { + LicenseType = HybridComputeLicenseType.Esu, + LicenseDetails = new HybridComputeLicenseDetails() + { + State = HybridComputeLicenseState.Activated, + Target = HybridComputeLicenseTarget.WindowsServer2012, + Edition = HybridComputeLicenseEdition.DataCenter, + LicenseCoreType = LicenseCoreType.PCore, + Processors = 6, + }, + }; + ArmOperation lro = await subscriptionResource.ValidateLicenseLicenseAsync(WaitUntil.Completed, data); + HybridComputeLicenseResource 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 + HybridComputeLicenseData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + // Create or Update a License [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateALicense() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/license/License_CreateOrUpdate.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/license/License_CreateOrUpdate.json // this example is just showing the usage of "Licenses_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 @@ -65,7 +107,7 @@ public async Task Update_CreateOrUpdateALicense() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetLicense() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/license/License_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/license/License_Get.json // this example is just showing the usage of "Licenses_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 @@ -96,7 +138,7 @@ public async Task Get_GetLicense() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteALicense() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/license/License_Delete.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/license/License_Delete.json // this example is just showing the usage of "Licenses_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 @@ -123,7 +165,7 @@ public async Task Delete_DeleteALicense() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetHybridComputeLicenses_ListLicensesBySubscription() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/license/License_ListBySubscription.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/license/License_ListBySubscription.json // this example is just showing the usage of "Licenses_ListBySubscription" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineCollection.cs index 959fcb7422d54..eafa57729bbce 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineCollection.cs @@ -9,18 +9,71 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; +using Azure.ResourceManager.HybridCompute.Models; +using Azure.ResourceManager.Models; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.HybridCompute.Samples { public partial class Sample_HybridComputeMachineCollection { + // Create or Update a Machine + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateOrUpdateAMachine() + { + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/machine/Machines_CreateOrUpdate.json + // this example is just showing the usage of "Machines_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 = "{subscriptionId}"; + string resourceGroupName = "myResourceGroup"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this HybridComputeMachineResource + HybridComputeMachineCollection collection = resourceGroupResource.GetHybridComputeMachines(); + + // invoke the operation + string machineName = "myMachine"; + HybridComputeMachineData data = new HybridComputeMachineData(new AzureLocation("eastus2euap")) + { + Identity = new ManagedServiceIdentity("SystemAssigned"), + LocationData = new HybridComputeLocation("Redmond"), + OSProfile = new HybridComputeOSProfile() + { + WindowsConfiguration = new HybridComputeWindowsConfiguration() + { + IsHotpatchingEnabled = true, + }, + }, + VmId = Guid.Parse("b7a098cc-b0b8-46e8-a205-62f301a62a8f"), + ClientPublicKey = "string", + PrivateLinkScopeResourceId = new ResourceIdentifier("/subscriptions/{subscriptionId}/resourceGroups/myResourceGroup/providers/Microsoft.HybridCompute/privateLinkScopes/privateLinkScopeName"), + ParentClusterResourceId = new ResourceIdentifier("{AzureStackHCIResourceId}"), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, machineName, data); + HybridComputeMachineResource 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 + HybridComputeMachineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + // Get Machine [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetMachine() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/machine/Machines_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/machine/Machines_Get.json // this example is just showing the usage of "Machines_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 @@ -54,7 +107,7 @@ public async Task Get_GetMachine() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetMachine() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/machine/Machines_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/machine/Machines_Get.json // this example is just showing the usage of "Machines_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 @@ -84,7 +137,7 @@ public async Task Exists_GetMachine() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetMachine() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/machine/Machines_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/machine/Machines_Get.json // this example is just showing the usage of "Machines_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 @@ -126,7 +179,7 @@ public async Task GetIfExists_GetMachine() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetMachineWithLicenseProfileInstanceView() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/machine/Machines_Get_LicenseProfileInstanceView.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/machine/Machines_Get_LicenseProfileInstanceView.json // this example is just showing the usage of "Machines_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 @@ -161,7 +214,7 @@ public async Task Get_GetMachineWithLicenseProfileInstanceView() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetMachineWithLicenseProfileInstanceView() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/machine/Machines_Get_LicenseProfileInstanceView.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/machine/Machines_Get_LicenseProfileInstanceView.json // this example is just showing the usage of "Machines_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 @@ -192,7 +245,7 @@ public async Task Exists_GetMachineWithLicenseProfileInstanceView() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetMachineWithLicenseProfileInstanceView() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/machine/Machines_Get_LicenseProfileInstanceView.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/machine/Machines_Get_LicenseProfileInstanceView.json // this example is just showing the usage of "Machines_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 @@ -235,7 +288,7 @@ public async Task GetIfExists_GetMachineWithLicenseProfileInstanceView() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_ListMachinesByResourceGroup() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/machine/Machines_ListByResourceGroup.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/machine/Machines_ListByResourceGroup.json // this example is just showing the usage of "Machines_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/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineExtensionCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineExtensionCollection.cs index 5ce6c15a5c07d..41edd2d612b8d 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineExtensionCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineExtensionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_HybridComputeMachineExtensionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_CreateOrUpdateAMachineExtension() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/extension/Extension_CreateOrUpdate.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/extension/Extension_CreateOrUpdate.json // this example is just showing the usage of "MachineExtensions_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 @@ -69,7 +69,7 @@ public async Task CreateOrUpdate_CreateOrUpdateAMachineExtension() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GETMachineExtension() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/extension/Extension_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/extension/Extension_Get.json // this example is just showing the usage of "MachineExtensions_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -104,7 +104,7 @@ public async Task Get_GETMachineExtension() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GETMachineExtension() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/extension/Extension_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/extension/Extension_Get.json // this example is just showing the usage of "MachineExtensions_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 @@ -135,7 +135,7 @@ public async Task Exists_GETMachineExtension() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GETMachineExtension() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/extension/Extension_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/extension/Extension_Get.json // this example is just showing the usage of "MachineExtensions_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 @@ -178,7 +178,7 @@ public async Task GetIfExists_GETMachineExtension() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GETAllMachineExtensionsList() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/extension/Extension_List.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/extension/Extension_List.json // this example is just showing the usage of "MachineExtensions_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineExtensionResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineExtensionResource.cs index e4cffeaa76b53..aa32f1802e019 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineExtensionResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineExtensionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_HybridComputeMachineExtensionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_CreateOrUpdateAMachineExtension() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/extension/Extension_Update.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/extension/Extension_Update.json // this example is just showing the usage of "MachineExtensions_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 @@ -64,7 +64,7 @@ public async Task Update_CreateOrUpdateAMachineExtension() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteAMachineExtension() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/extension/Extension_Delete.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/extension/Extension_Delete.json // this example is just showing the usage of "MachineExtensions_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 @@ -92,7 +92,7 @@ public async Task Delete_DeleteAMachineExtension() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GETMachineExtension() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/extension/Extension_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/extension/Extension_Get.json // this example is just showing the usage of "MachineExtensions_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/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineResource.cs index 98371ee0cc594..0bd98f2599e06 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineResource.cs @@ -23,7 +23,7 @@ public partial class Sample_HybridComputeMachineResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_UpdateAMachine() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/machine/Machines_Update.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/machine/Machines_Update.json // this example is just showing the usage of "Machines_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 @@ -75,7 +75,7 @@ public async Task Update_UpdateAMachine() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeleteAMachine() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/machine/Machines_Delete.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/machine/Machines_Delete.json // this example is just showing the usage of "Machines_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 @@ -102,7 +102,7 @@ public async Task Delete_DeleteAMachine() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetMachine() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/machine/Machines_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/machine/Machines_Get.json // this example is just showing the usage of "Machines_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 @@ -133,7 +133,7 @@ public async Task Get_GetMachine() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetMachineWithLicenseProfileInstanceView() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/machine/Machines_Get_LicenseProfileInstanceView.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/machine/Machines_Get_LicenseProfileInstanceView.json // this example is just showing the usage of "Machines_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 @@ -165,7 +165,7 @@ public async Task Get_GetMachineWithLicenseProfileInstanceView() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task AssessPatches_AssessPatchStateOfAMachine() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/machine/Machine_AssessPatches.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/machine/Machine_AssessPatches.json // this example is just showing the usage of "Machines_AssessPatches" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -193,7 +193,7 @@ public async Task AssessPatches_AssessPatchStateOfAMachine() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task InstallPatches_InstallPatchStateOfAMachine() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/machine/Machine_InstallPatches.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/machine/Machine_InstallPatches.json // this example is just showing the usage of "Machines_InstallPatches" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -232,7 +232,7 @@ public async Task InstallPatches_InstallPatchStateOfAMachine() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetHybridComputeMachines_ListMachinesByResourceGroup() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/machine/Machines_ListBySubscription.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/machine/Machines_ListBySubscription.json // this example is just showing the usage of "Machines_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 @@ -264,7 +264,7 @@ public async Task GetHybridComputeMachines_ListMachinesByResourceGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task UpgradeExtensions_UpgradeMachineExtensions() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/extension/Extensions_Upgrade.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/extension/Extensions_Upgrade.json // this example is just showing the usage of "UpgradeExtensions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -305,7 +305,7 @@ public async Task UpgradeExtensions_UpgradeMachineExtensions() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetNetworkProfile_GETNetworkProfile() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/NetworkProfile_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/NetworkProfile_Get.json // this example is just showing the usage of "NetworkProfile_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 @@ -332,7 +332,7 @@ public async Task GetNetworkProfile_GETNetworkProfile() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetValidationDetailsForMachinePrivateLinkScope_PrivateLinkScopeGet() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateLinkScope/PrivateLinkScopes_GetValidationForMachine.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopes_GetValidationForMachine.json // this example is just showing the usage of "PrivateLinkScopes_GetValidationDetailsForMachine" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateEndpointConnectionCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateEndpointConnectionCollection.cs index 58f5c8ae798b6..9503861fcaa0d 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateEndpointConnectionCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateEndpointConnectionCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_HybridComputePrivateEndpointConnectionCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateEndpoint/PrivateEndpointConnection_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateEndpoint/PrivateEndpointConnection_Get.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -55,7 +55,7 @@ public async Task Get_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateEndpoint/PrivateEndpointConnection_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateEndpoint/PrivateEndpointConnection_Get.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -86,7 +86,7 @@ public async Task Exists_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateEndpoint/PrivateEndpointConnection_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateEndpoint/PrivateEndpointConnection_Get.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -129,7 +129,7 @@ public async Task GetIfExists_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_ApproveOrRejectAPrivateEndpointConnectionWithAGivenName() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateEndpoint/PrivateEndpointConnection_Update.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateEndpoint/PrivateEndpointConnection_Update.json // this example is just showing the usage of "PrivateEndpointConnections_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -172,7 +172,7 @@ public async Task CreateOrUpdate_ApproveOrRejectAPrivateEndpointConnectionWithAG [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GetsListOfPrivateEndpointConnectionsOnAPrivateLinkScope() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateEndpoint/PrivateEndpointConnection_List.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateEndpoint/PrivateEndpointConnection_List.json // this example is just showing the usage of "PrivateEndpointConnections_ListByPrivateLinkScope" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateEndpointConnectionResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateEndpointConnectionResource.cs index a7403d83761ac..d5388a49cc8ee 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateEndpointConnectionResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateEndpointConnectionResource.cs @@ -20,7 +20,7 @@ public partial class Sample_HybridComputePrivateEndpointConnectionResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateEndpoint/PrivateEndpointConnection_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateEndpoint/PrivateEndpointConnection_Get.json // this example is just showing the usage of "PrivateEndpointConnections_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_ApproveOrRejectAPrivateEndpointConnectionWithAGivenName() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateEndpoint/PrivateEndpointConnection_Update.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateEndpoint/PrivateEndpointConnection_Update.json // this example is just showing the usage of "PrivateEndpointConnections_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -92,7 +92,7 @@ public async Task Update_ApproveOrRejectAPrivateEndpointConnectionWithAGivenName [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_DeletesAPrivateEndpointConnectionWithAGivenName() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateEndpoint/PrivateEndpointConnection_Delete.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateEndpoint/PrivateEndpointConnection_Delete.json // this example is just showing the usage of "PrivateEndpointConnections_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkResource.cs index 96f9b52370d64..a2b061a354a85 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkResource.cs @@ -19,7 +19,7 @@ public partial class Sample_HybridComputePrivateLinkResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateLinkScope/PrivateLinkScopePrivateLinkResource_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopePrivateLinkResource_Get.json // this example is just showing the usage of "PrivateLinkResources_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkResourceCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkResourceCollection.cs index 60272471ecf9d..42eafc732d2fe 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkResourceCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkResourceCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_HybridComputePrivateLinkResourceCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateLinkScope/PrivateLinkScopePrivateLinkResource_ListGet.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopePrivateLinkResource_ListGet.json // this example is just showing the usage of "PrivateLinkResources_ListByPrivateLinkScope" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateLinkScope/PrivateLinkScopePrivateLinkResource_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopePrivateLinkResource_Get.json // this example is just showing the usage of "PrivateLinkResources_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -91,7 +91,7 @@ public async Task Get_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateLinkScope/PrivateLinkScopePrivateLinkResource_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopePrivateLinkResource_Get.json // this example is just showing the usage of "PrivateLinkResources_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -122,7 +122,7 @@ public async Task Exists_GetsPrivateEndpointConnection() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetsPrivateEndpointConnection() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateLinkScope/PrivateLinkScopePrivateLinkResource_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopePrivateLinkResource_Get.json // this example is just showing the usage of "PrivateLinkResources_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkScopeCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkScopeCollection.cs index 161dd96e3778e..a38b565cb12e7 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkScopeCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkScopeCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_HybridComputePrivateLinkScopeCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_PrivateLinkScopeListByResourceGroup() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateLinkScope/PrivateLinkScopes_ListByResourceGroup.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopes_ListByResourceGroup.json // this example is just showing the usage of "PrivateLinkScopes_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 @@ -56,7 +56,7 @@ public async Task GetAll_PrivateLinkScopeListByResourceGroup() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_PrivateLinkScopeGet() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateLinkScope/PrivateLinkScopes_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopes_Get.json // this example is just showing the usage of "PrivateLinkScopes_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 @@ -90,7 +90,7 @@ public async Task Get_PrivateLinkScopeGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_PrivateLinkScopeGet() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateLinkScope/PrivateLinkScopes_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopes_Get.json // this example is just showing the usage of "PrivateLinkScopes_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 @@ -120,7 +120,7 @@ public async Task Exists_PrivateLinkScopeGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_PrivateLinkScopeGet() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateLinkScope/PrivateLinkScopes_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopes_Get.json // this example is just showing the usage of "PrivateLinkScopes_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 GetIfExists_PrivateLinkScopeGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_PrivateLinkScopeCreate() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateLinkScope/PrivateLinkScopes_Create.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopes_Create.json // this example is just showing the usage of "PrivateLinkScopes_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 @@ -198,7 +198,7 @@ public async Task CreateOrUpdate_PrivateLinkScopeCreate() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task CreateOrUpdate_PrivateLinkScopeUpdate() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateLinkScope/PrivateLinkScopes_Update.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopes_Update.json // this example is just showing the usage of "PrivateLinkScopes_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkScopeResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkScopeResource.cs index 72268c0d432f2..9158ce350ab0d 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkScopeResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputePrivateLinkScopeResource.cs @@ -21,7 +21,7 @@ public partial class Sample_HybridComputePrivateLinkScopeResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetHybridComputePrivateLinkScopes_PrivateLinkScopesListJson() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateLinkScope/PrivateLinkScopes_List.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopes_List.json // this example is just showing the usage of "PrivateLinkScopes_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -53,7 +53,7 @@ public async Task GetHybridComputePrivateLinkScopes_PrivateLinkScopesListJson() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Delete_PrivateLinkScopesDelete() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateLinkScope/PrivateLinkScopes_Delete.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopes_Delete.json // this example is just showing the usage of "PrivateLinkScopes_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 @@ -80,7 +80,7 @@ public async Task Delete_PrivateLinkScopesDelete() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_PrivateLinkScopeGet() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateLinkScope/PrivateLinkScopes_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopes_Get.json // this example is just showing the usage of "PrivateLinkScopes_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 @@ -111,7 +111,7 @@ public async Task Get_PrivateLinkScopeGet() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Update_PrivateLinkScopeUpdateTagsOnly() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateLinkScope/PrivateLinkScopes_UpdateTagsOnly.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopes_UpdateTagsOnly.json // this example is just showing the usage of "PrivateLinkScopes_UpdateTags" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -150,7 +150,7 @@ public async Task Update_PrivateLinkScopeUpdateTagsOnly() [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetValidationDetailsPrivateLinkScope_PrivateLinkScopeGet() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/privateLinkScope/PrivateLinkScopes_GetValidation.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/privateLinkScope/PrivateLinkScopes_GetValidation.json // this example is just showing the usage of "PrivateLinkScopes_GetValidationDetails" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_LicenseProfileResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_LicenseProfileResource.cs new file mode 100644 index 0000000000000..4581d2961c48c --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_LicenseProfileResource.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.HybridCompute.Models; + +namespace Azure.ResourceManager.HybridCompute.Samples +{ + public partial class Sample_LicenseProfileResource + { + // Create or Update a License Profile + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task CreateOrUpdate_CreateOrUpdateALicenseProfile() + { + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/licenseProfile/LicenseProfile_CreateOrUpdate.json + // this example is just showing the usage of "LicenseProfiles_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 LicenseProfileResource created on azure + // for more information of creating LicenseProfileResource, please refer to the document of LicenseProfileResource + string subscriptionId = "{subscriptionId}"; + string resourceGroupName = "myResourceGroup"; + string machineName = "myMachine"; + ResourceIdentifier licenseProfileResourceId = LicenseProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, machineName); + LicenseProfileResource licenseProfile = client.GetLicenseProfileResource(licenseProfileResourceId); + + // invoke the operation + LicenseProfileData data = new LicenseProfileData(new AzureLocation("eastus2euap")) + { + SubscriptionStatus = LicenseProfileSubscriptionStatus.Enabled, + ProductType = LicenseProfileProductType.WindowsServer, + ProductFeatures = +{ +new HybridComputeProductFeature() +{ +Name = "Hotpatch", +SubscriptionStatus = LicenseProfileSubscriptionStatus.Enabled, +} +}, + AssignedLicense = "{LicenseResourceId}", + SoftwareAssuranceCustomer = true, + }; + ArmOperation lro = await licenseProfile.CreateOrUpdateAsync(WaitUntil.Completed, data); + LicenseProfileResource 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 + LicenseProfileData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Update a License Profile + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Update_UpdateALicenseProfile() + { + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/licenseProfile/LicenseProfile_Update.json + // this example is just showing the usage of "LicenseProfiles_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 LicenseProfileResource created on azure + // for more information of creating LicenseProfileResource, please refer to the document of LicenseProfileResource + string subscriptionId = "{subscriptionId}"; + string resourceGroupName = "myResourceGroup"; + string machineName = "myMachine"; + ResourceIdentifier licenseProfileResourceId = LicenseProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, machineName); + LicenseProfileResource licenseProfile = client.GetLicenseProfileResource(licenseProfileResourceId); + + // invoke the operation + LicenseProfilePatch patch = new LicenseProfilePatch() + { + SubscriptionStatus = LicenseProfileSubscriptionStatusUpdate.Enable, + ProductType = LicenseProfileProductType.WindowsServer, + ProductFeatures = +{ +new ProductFeatureUpdate() +{ +Name = "Hotpatch", +SubscriptionStatus = LicenseProfileSubscriptionStatusUpdate.Enable, +} +}, + AssignedLicense = "{LicenseResourceId}", + SoftwareAssuranceCustomer = true, + }; + ArmOperation lro = await licenseProfile.UpdateAsync(WaitUntil.Completed, patch); + LicenseProfileResource 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 + LicenseProfileData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Get License Profile + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Get_GetLicenseProfile() + { + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/licenseProfile/LicenseProfile_Get.json + // this example is just showing the usage of "LicenseProfiles_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this LicenseProfileResource created on azure + // for more information of creating LicenseProfileResource, please refer to the document of LicenseProfileResource + string subscriptionId = "{subscriptionId}"; + string resourceGroupName = "myResourceGroup"; + string machineName = "myMachine"; + ResourceIdentifier licenseProfileResourceId = LicenseProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, machineName); + LicenseProfileResource licenseProfile = client.GetLicenseProfileResource(licenseProfileResourceId); + + // invoke the operation + LicenseProfileResource result = await licenseProfile.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + LicenseProfileData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + // Delete a License Profile + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task Delete_DeleteALicenseProfile() + { + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/licenseProfile/LicenseProfile_Delete.json + // this example is just showing the usage of "LicenseProfiles_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this LicenseProfileResource created on azure + // for more information of creating LicenseProfileResource, please refer to the document of LicenseProfileResource + string subscriptionId = "{subscriptionId}"; + string resourceGroupName = "myResourceGroup"; + string machineName = "myMachine"; + ResourceIdentifier licenseProfileResourceId = LicenseProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, machineName); + LicenseProfileResource licenseProfile = client.GetLicenseProfileResource(licenseProfileResourceId); + + // invoke the operation + await licenseProfile.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine($"Succeeded"); + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_MachineRunCommandCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_MachineRunCommandCollection.cs deleted file mode 100644 index 6a33a25bedc1d..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_MachineRunCommandCollection.cs +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.HybridCompute.Models; - -namespace Azure.ResourceManager.HybridCompute.Samples -{ - public partial class Sample_MachineRunCommandCollection - { - // Create or Update a Run Command - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task CreateOrUpdate_CreateOrUpdateARunCommand() - { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/runCommand/RunCommands_CreateOrUpdate.json - // this example is just showing the usage of "MachineRunCommands_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 HybridComputeMachineResource created on azure - // for more information of creating HybridComputeMachineResource, please refer to the document of HybridComputeMachineResource - string subscriptionId = "{subscriptionId}"; - string resourceGroupName = "myResourceGroup"; - string machineName = "myMachine"; - ResourceIdentifier hybridComputeMachineResourceId = HybridComputeMachineResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, machineName); - HybridComputeMachineResource hybridComputeMachine = client.GetHybridComputeMachineResource(hybridComputeMachineResourceId); - - // get the collection of this MachineRunCommandResource - MachineRunCommandCollection collection = hybridComputeMachine.GetMachineRunCommands(); - - // invoke the operation - string runCommandName = "myRunCommand"; - MachineRunCommandData data = new MachineRunCommandData(new AzureLocation("eastus2")) - { - Source = new MachineRunCommandScriptSource() - { - Script = "Write-Host Hello World!", - }, - Parameters = -{ -new RunCommandInputParameter("param1","value1"),new RunCommandInputParameter("param2","value2") -}, - AsyncExecution = false, - RunAsUser = "user1", - RunAsPassword = "", - TimeoutInSeconds = 3600, - OutputBlobUri = new Uri("https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt"), - ErrorBlobUri = new Uri("https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt"), - }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, runCommandName, data); - MachineRunCommandResource 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 - MachineRunCommandData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Get a Run Command - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_GetARunCommand() - { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/runCommand/RunCommands_Get.json - // this example is just showing the usage of "MachineRunCommands_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridComputeMachineResource created on azure - // for more information of creating HybridComputeMachineResource, please refer to the document of HybridComputeMachineResource - string subscriptionId = "{subscriptionId}"; - string resourceGroupName = "myResourceGroup"; - string machineName = "myMachine"; - ResourceIdentifier hybridComputeMachineResourceId = HybridComputeMachineResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, machineName); - HybridComputeMachineResource hybridComputeMachine = client.GetHybridComputeMachineResource(hybridComputeMachineResourceId); - - // get the collection of this MachineRunCommandResource - MachineRunCommandCollection collection = hybridComputeMachine.GetMachineRunCommands(); - - // invoke the operation - string runCommandName = "myRunCommand"; - MachineRunCommandResource result = await collection.GetAsync(runCommandName); - - // 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 - MachineRunCommandData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Get a Run Command - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Exists_GetARunCommand() - { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/runCommand/RunCommands_Get.json - // this example is just showing the usage of "MachineRunCommands_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridComputeMachineResource created on azure - // for more information of creating HybridComputeMachineResource, please refer to the document of HybridComputeMachineResource - string subscriptionId = "{subscriptionId}"; - string resourceGroupName = "myResourceGroup"; - string machineName = "myMachine"; - ResourceIdentifier hybridComputeMachineResourceId = HybridComputeMachineResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, machineName); - HybridComputeMachineResource hybridComputeMachine = client.GetHybridComputeMachineResource(hybridComputeMachineResourceId); - - // get the collection of this MachineRunCommandResource - MachineRunCommandCollection collection = hybridComputeMachine.GetMachineRunCommands(); - - // invoke the operation - string runCommandName = "myRunCommand"; - bool result = await collection.ExistsAsync(runCommandName); - - Console.WriteLine($"Succeeded: {result}"); - } - - // Get a Run Command - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetIfExists_GetARunCommand() - { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/runCommand/RunCommands_Get.json - // this example is just showing the usage of "MachineRunCommands_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridComputeMachineResource created on azure - // for more information of creating HybridComputeMachineResource, please refer to the document of HybridComputeMachineResource - string subscriptionId = "{subscriptionId}"; - string resourceGroupName = "myResourceGroup"; - string machineName = "myMachine"; - ResourceIdentifier hybridComputeMachineResourceId = HybridComputeMachineResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, machineName); - HybridComputeMachineResource hybridComputeMachine = client.GetHybridComputeMachineResource(hybridComputeMachineResourceId); - - // get the collection of this MachineRunCommandResource - MachineRunCommandCollection collection = hybridComputeMachine.GetMachineRunCommands(); - - // invoke the operation - string runCommandName = "myRunCommand"; - NullableResponse response = await collection.GetIfExistsAsync(runCommandName); - MachineRunCommandResource result = response.HasValue ? response.Value : null; - - if (result == null) - { - Console.WriteLine($"Succeeded with null as result"); - } - else - { - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - MachineRunCommandData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } - - // GET all Machine Run Commands - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetAll_GETAllMachineRunCommands() - { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/runCommand/RunCommands_List.json - // this example is just showing the usage of "MachineRunCommands_List" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this HybridComputeMachineResource created on azure - // for more information of creating HybridComputeMachineResource, please refer to the document of HybridComputeMachineResource - string subscriptionId = "{subscriptionId}"; - string resourceGroupName = "myResourceGroup"; - string machineName = "myMachine"; - ResourceIdentifier hybridComputeMachineResourceId = HybridComputeMachineResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, machineName); - HybridComputeMachineResource hybridComputeMachine = client.GetHybridComputeMachineResource(hybridComputeMachineResourceId); - - // get the collection of this MachineRunCommandResource - MachineRunCommandCollection collection = hybridComputeMachine.GetMachineRunCommands(); - - // invoke the operation and iterate over the result - await foreach (MachineRunCommandResource item in collection.GetAllAsync()) - { - // the variable item is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - MachineRunCommandData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - Console.WriteLine($"Succeeded"); - } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_MachineRunCommandResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_MachineRunCommandResource.cs deleted file mode 100644 index 54a5b34be7461..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_MachineRunCommandResource.cs +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.HybridCompute.Models; - -namespace Azure.ResourceManager.HybridCompute.Samples -{ - public partial class Sample_MachineRunCommandResource - { - // Create or Update a Run Command - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CreateOrUpdateARunCommand() - { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/runCommand/RunCommands_CreateOrUpdate.json - // this example is just showing the usage of "MachineRunCommands_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 MachineRunCommandResource created on azure - // for more information of creating MachineRunCommandResource, please refer to the document of MachineRunCommandResource - string subscriptionId = "{subscriptionId}"; - string resourceGroupName = "myResourceGroup"; - string machineName = "myMachine"; - string runCommandName = "myRunCommand"; - ResourceIdentifier machineRunCommandResourceId = MachineRunCommandResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, machineName, runCommandName); - MachineRunCommandResource machineRunCommand = client.GetMachineRunCommandResource(machineRunCommandResourceId); - - // invoke the operation - MachineRunCommandData data = new MachineRunCommandData(new AzureLocation("eastus2")) - { - Source = new MachineRunCommandScriptSource() - { - Script = "Write-Host Hello World!", - }, - Parameters = -{ -new RunCommandInputParameter("param1","value1"),new RunCommandInputParameter("param2","value2") -}, - AsyncExecution = false, - RunAsUser = "user1", - RunAsPassword = "", - TimeoutInSeconds = 3600, - OutputBlobUri = new Uri("https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt"), - ErrorBlobUri = new Uri("https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt"), - }; - ArmOperation lro = await machineRunCommand.UpdateAsync(WaitUntil.Completed, data); - MachineRunCommandResource 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 - MachineRunCommandData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - // Delete a Machine Run Command - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Delete_DeleteAMachineRunCommand() - { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/runCommand/RunCommands_Delete.json - // this example is just showing the usage of "MachineRunCommands_Delete" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MachineRunCommandResource created on azure - // for more information of creating MachineRunCommandResource, please refer to the document of MachineRunCommandResource - string subscriptionId = "{subscriptionId}"; - string resourceGroupName = "myResourceGroup"; - string machineName = "myMachine"; - string runCommandName = "myRunCommand"; - ResourceIdentifier machineRunCommandResourceId = MachineRunCommandResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, machineName, runCommandName); - MachineRunCommandResource machineRunCommand = client.GetMachineRunCommandResource(machineRunCommandResourceId); - - // invoke the operation - await machineRunCommand.DeleteAsync(WaitUntil.Completed); - - Console.WriteLine($"Succeeded"); - } - - // Get a Run Command - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Get_GetARunCommand() - { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/runCommand/RunCommands_Get.json - // this example is just showing the usage of "MachineRunCommands_Get" operation, for the dependent resources, they will have to be created separately. - - // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line - TokenCredential cred = new DefaultAzureCredential(); - // authenticate your client - ArmClient client = new ArmClient(cred); - - // this example assumes you already have this MachineRunCommandResource created on azure - // for more information of creating MachineRunCommandResource, please refer to the document of MachineRunCommandResource - string subscriptionId = "{subscriptionId}"; - string resourceGroupName = "myResourceGroup"; - string machineName = "myMachine"; - string runCommandName = "myRunCommand"; - ResourceIdentifier machineRunCommandResourceId = MachineRunCommandResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, machineName, runCommandName); - MachineRunCommandResource machineRunCommand = client.GetMachineRunCommandResource(machineRunCommandResourceId); - - // invoke the operation - MachineRunCommandResource result = await machineRunCommand.GetAsync(); - - // the variable result is a resource, you could call other operations on this instance as well - // but just for demo, we get its data from this resource instance - MachineRunCommandData resourceData = result.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs index aaf9fa758c931..e98a938117872 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationCollection.cs @@ -19,7 +19,7 @@ public partial class Sample_NetworkSecurityPerimeterConfigurationCollection [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsTheNetworkSecurityPerimeterConfigurationOfThePrivateLinkScope() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationGet.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationGet.json // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_GetByPrivateLinkScope" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -54,7 +54,7 @@ public async Task Get_GetsTheNetworkSecurityPerimeterConfigurationOfThePrivateLi [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Exists_GetsTheNetworkSecurityPerimeterConfigurationOfThePrivateLinkScope() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationGet.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationGet.json // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_GetByPrivateLinkScope" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -85,7 +85,7 @@ public async Task Exists_GetsTheNetworkSecurityPerimeterConfigurationOfThePrivat [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetIfExists_GetsTheNetworkSecurityPerimeterConfigurationOfThePrivateLinkScope() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationGet.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationGet.json // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_GetByPrivateLinkScope" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -128,7 +128,7 @@ public async Task GetIfExists_GetsTheNetworkSecurityPerimeterConfigurationOfTheP [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task GetAll_GetsTheListOfNetworkSecurityPerimeterConfigurationsOfThePrivateLinkScope() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationList.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationList.json // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_ListByPrivateLinkScope" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationResource.cs index e33394f7fccc9..64e73817261ea 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_NetworkSecurityPerimeterConfigurationResource.cs @@ -9,6 +9,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; +using Azure.ResourceManager.HybridCompute.Models; namespace Azure.ResourceManager.HybridCompute.Samples { @@ -19,7 +20,7 @@ public partial class Sample_NetworkSecurityPerimeterConfigurationResource [NUnit.Framework.Ignore("Only verifying that the sample builds")] public async Task Get_GetsTheNetworkSecurityPerimeterConfigurationOfThePrivateLinkScope() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationGet.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationGet.json // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_GetByPrivateLinkScope" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -45,5 +46,34 @@ public async Task Get_GetsTheNetworkSecurityPerimeterConfigurationOfThePrivateLi // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } + + // Reconciles the network security perimeter configuration of the private link scope. + [NUnit.Framework.Test] + [NUnit.Framework.Ignore("Only verifying that the sample builds")] + public async Task ReconcileForPrivateLinkScope_ReconcilesTheNetworkSecurityPerimeterConfigurationOfThePrivateLinkScope() + { + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/stable/2024-07-10/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationReconcile.json + // this example is just showing the usage of "NetworkSecurityPerimeterConfigurations_ReconcileForPrivateLinkScope" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK 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 NetworkSecurityPerimeterConfigurationResource created on azure + // for more information of creating NetworkSecurityPerimeterConfigurationResource, please refer to the document of NetworkSecurityPerimeterConfigurationResource + string subscriptionId = "00000000-1111-2222-3333-444444444444"; + string resourceGroupName = "my-resource-group"; + string scopeName = "my-privatelinkscope"; + string perimeterName = "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee.myAssociation"; + ResourceIdentifier networkSecurityPerimeterConfigurationResourceId = NetworkSecurityPerimeterConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, scopeName, perimeterName); + NetworkSecurityPerimeterConfigurationResource networkSecurityPerimeterConfiguration = client.GetNetworkSecurityPerimeterConfigurationResource(networkSecurityPerimeterConfigurationResourceId); + + // invoke the operation + ArmOperation lro = await networkSecurityPerimeterConfiguration.ReconcileForPrivateLinkScopeAsync(WaitUntil.Completed); + NetworkSecurityPerimeterConfigurationReconcileResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs deleted file mode 100644 index 447dfa6793767..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Identity; -using Azure.ResourceManager.HybridCompute.Models; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.HybridCompute.Samples -{ - public partial class Sample_ResourceGroupResourceExtensions - { - // SettingsUpdate - [NUnit.Framework.Test] - [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task UpdateTargetResourceSetting_SettingsUpdate() - { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/settings/SettingsUpdate.json - // this example is just showing the usage of "Settings_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 ResourceGroupResource created on azure - // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource - string subscriptionId = "00000000-1111-2222-3333-444444444444"; - string resourceGroupName = "hybridRG"; - ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); - ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - - // invoke the operation - string baseProvider = "Microsoft.HybridCompute"; - string baseResourceType = "machines"; - string baseResourceName = "testMachine"; - string settingsResourceName = "default"; - HybridComputeTargetResourceSettings hybridComputeTargetResourceSettings = new HybridComputeTargetResourceSettings() - { - GatewayResourceId = new ResourceIdentifier("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/gateways/newGateway"), - }; - HybridComputeTargetResourceSettings result = await resourceGroupResource.UpdateTargetResourceSettingAsync(baseProvider, baseResourceType, baseResourceName, settingsResourceName, hybridComputeTargetResourceSettings); - - Console.WriteLine($"Succeeded: {result}"); - } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArmHybridComputeModelFactory.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArmHybridComputeModelFactory.cs index 474aa1f9274ba..baa47328f4bc6 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArmHybridComputeModelFactory.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArmHybridComputeModelFactory.cs @@ -72,69 +72,6 @@ public static HybridComputeLicenseDetails HybridComputeLicenseDetails(HybridComp serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// Specifies the host OS name of the hybrid machine. - /// Specifies the windows configuration for update management. - /// Specifies the linux configuration for update management. - /// A new instance for mocking. - public static HybridComputeOSProfile HybridComputeOSProfile(string computerName = null, HybridComputeWindowsConfiguration windowsConfiguration = null, HybridComputeLinuxConfiguration linuxConfiguration = null) - { - return new HybridComputeOSProfile(computerName, windowsConfiguration, linuxConfiguration, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Specifies the assessment mode. - /// Specifies the patch mode. - /// Captures the hotpatch capability enrollment intent of the customers, which enables customers to patch their Windows machines without requiring a reboot. - /// Status of the hotpatch capability enrollment or disenrollment. - /// A new instance for mocking. - public static HybridComputeWindowsConfiguration HybridComputeWindowsConfiguration(AssessmentModeType? assessmentMode = null, PatchModeType? patchMode = null, bool? isHotpatchingEnabled = null, HybridComputePatchSettingsStatus status = null) - { - return new HybridComputeWindowsConfiguration(assessmentMode, patchMode, isHotpatchingEnabled, status, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Indicates the current status of the hotpatch being enabled or disabled. - /// The errors that were encountered during the hotpatch capability enrollment or disenrollment. - /// A new instance for mocking. - public static HybridComputePatchSettingsStatus HybridComputePatchSettingsStatus(HotpatchEnablementStatus? hotpatchEnablementStatus = null, ResponseError error = null) - { - return new HybridComputePatchSettingsStatus(hotpatchEnablementStatus, error, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Specifies the assessment mode. - /// Specifies the patch mode. - /// Captures the hotpatch capability enrollment intent of the customers, which enables customers to patch their Windows machines without requiring a reboot. - /// Status of the hotpatch capability enrollment or disenrollment. - /// A new instance for mocking. - public static HybridComputeLinuxConfiguration HybridComputeLinuxConfiguration(AssessmentModeType? assessmentMode = null, PatchModeType? patchMode = null, bool? isHotpatchingEnabled = null, HybridComputePatchSettingsStatus status = null) - { - return new HybridComputeLinuxConfiguration(assessmentMode, patchMode, isHotpatchingEnabled, status, serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Specifies the version info w.r.t AgentUpgrade for the machine. - /// The correlation ID passed in from RSM per upgrade. - /// Specifies if RSM should try to upgrade this machine. - /// Specifies the version of the last attempt. - /// Timestamp of last upgrade attempt. - /// Specifies the status of Agent Upgrade. - /// Failure message of last upgrade attempt if any. - /// A new instance for mocking. - public static AgentUpgrade AgentUpgrade(string desiredVersion = null, Guid? correlationId = null, bool? isAutomaticUpgradeEnabled = null, string lastAttemptDesiredVersion = null, DateTimeOffset? lastAttemptedOn = null, LastAttemptStatusEnum? lastAttemptStatus = null, string lastAttemptMessage = null) - { - return new AgentUpgrade( - desiredVersion, - correlationId, - isAutomaticUpgradeEnabled, - lastAttemptDesiredVersion, - lastAttemptedOn, - lastAttemptStatus, - lastAttemptMessage, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The id. /// The name. @@ -268,6 +205,69 @@ public static HybridComputeConfigurationExtension HybridComputeConfigurationExte return new HybridComputeConfigurationExtension(publisher, configurationExtensionType, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// Specifies the version info w.r.t AgentUpgrade for the machine. + /// The correlation ID passed in from RSM per upgrade. + /// Specifies if RSM should try to upgrade this machine. + /// Specifies the version of the last attempt. + /// Timestamp of last upgrade attempt. + /// Specifies the status of Agent Upgrade. + /// Failure message of last upgrade attempt if any. + /// A new instance for mocking. + public static AgentUpgrade AgentUpgrade(string desiredVersion = null, Guid? correlationId = null, bool? isAutomaticUpgradeEnabled = null, string lastAttemptDesiredVersion = null, DateTimeOffset? lastAttemptedOn = null, LastAttemptStatusEnum? lastAttemptStatus = null, string lastAttemptMessage = null) + { + return new AgentUpgrade( + desiredVersion, + correlationId, + isAutomaticUpgradeEnabled, + lastAttemptDesiredVersion, + lastAttemptedOn, + lastAttemptStatus, + lastAttemptMessage, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Specifies the host OS name of the hybrid machine. + /// Specifies the windows configuration for update management. + /// Specifies the linux configuration for update management. + /// A new instance for mocking. + public static HybridComputeOSProfile HybridComputeOSProfile(string computerName = null, HybridComputeWindowsConfiguration windowsConfiguration = null, HybridComputeLinuxConfiguration linuxConfiguration = null) + { + return new HybridComputeOSProfile(computerName, windowsConfiguration, linuxConfiguration, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Specifies the assessment mode. + /// Specifies the patch mode. + /// Captures the hotpatch capability enrollment intent of the customers, which enables customers to patch their Windows machines without requiring a reboot. + /// Status of the hotpatch capability enrollment or disenrollment. + /// A new instance for mocking. + public static HybridComputeWindowsConfiguration HybridComputeWindowsConfiguration(AssessmentModeType? assessmentMode = null, PatchModeType? patchMode = null, bool? isHotpatchingEnabled = null, HybridComputePatchSettingsStatus status = null) + { + return new HybridComputeWindowsConfiguration(assessmentMode, patchMode, isHotpatchingEnabled, status, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Indicates the current status of the hotpatch being enabled or disabled. + /// The errors that were encountered during the hotpatch capability enrollment or disenrollment. + /// A new instance for mocking. + public static HybridComputePatchSettingsStatus HybridComputePatchSettingsStatus(HotpatchEnablementStatus? hotpatchEnablementStatus = null, ResponseError error = null) + { + return new HybridComputePatchSettingsStatus(hotpatchEnablementStatus, error, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Specifies the assessment mode. + /// Specifies the patch mode. + /// Captures the hotpatch capability enrollment intent of the customers, which enables customers to patch their Windows machines without requiring a reboot. + /// Status of the hotpatch capability enrollment or disenrollment. + /// A new instance for mocking. + public static HybridComputeLinuxConfiguration HybridComputeLinuxConfiguration(AssessmentModeType? assessmentMode = null, PatchModeType? patchMode = null, bool? isHotpatchingEnabled = null, HybridComputePatchSettingsStatus status = null) + { + return new HybridComputeLinuxConfiguration(assessmentMode, patchMode, isHotpatchingEnabled, status, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// Indicates the license status of the OS. /// Indicates the license channel. @@ -473,6 +473,62 @@ public static MachineExtensionProperties MachineExtensionProperties(string force serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The provisioning state, which only appears in the response. + /// Indicates the subscription status of the product. + /// Indicates the product type of the license. + /// The timestamp in UTC when the user enrolls the feature. + /// The timestamp in UTC when the billing starts. + /// The timestamp in UTC when the user disenrolled the feature. + /// The timestamp in UTC when the billing ends. + /// The errors that were encountered during the feature enrollment or disenrollment. + /// The list of product features. + /// The guid id of the license. + /// The list of ESU keys. + /// The type of the Esu servers. + /// Indicates the eligibility state of Esu. + /// Indicates whether there is an ESU Key currently active for the machine. + /// The resource id of the license. + /// Specifies if this machine is licensed as part of a Software Assurance agreement. + /// A new instance for mocking. + public static LicenseProfileData LicenseProfileData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, HybridComputeProvisioningState? provisioningState = null, LicenseProfileSubscriptionStatus? subscriptionStatus = null, LicenseProfileProductType? productType = null, DateTimeOffset? enrollmentOn = null, DateTimeOffset? billingStartOn = null, DateTimeOffset? disenrollmentOn = null, DateTimeOffset? billingEndOn = null, ResponseError error = null, IEnumerable productFeatures = null, Guid? assignedLicenseImmutableId = null, IEnumerable esuKeys = null, EsuServerType? serverType = null, EsuEligibility? esuEligibility = null, EsuKeyState? esuKeyState = null, string assignedLicense = null, bool? softwareAssuranceCustomer = null) + { + tags ??= new Dictionary(); + productFeatures ??= new List(); + esuKeys ??= new List(); + + return new LicenseProfileData( + id, + name, + resourceType, + systemData, + tags, + location, + provisioningState, + subscriptionStatus, + productType, + enrollmentOn, + billingStartOn, + disenrollmentOn, + billingEndOn, + error, + productFeatures?.ToList(), + assignedLicenseImmutableId, + esuKeys?.ToList(), + serverType, + esuEligibility, + esuKeyState, + assignedLicense, + softwareAssuranceCustomer, + serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Unknown", "Failed", "Succeeded", or "CompletedWithWarnings.". /// The activity ID of the operation that produced this result. @@ -598,153 +654,6 @@ public static HybridComputeExtensionValueData HybridComputeExtensionValueData(Re serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The source of the run command script. - /// The parameters used by the script. - /// The parameters used by the script. - /// Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete. - /// Specifies the user account on the machine when executing the run command. - /// Specifies the user account password on the machine when executing the run command. - /// The timeout in seconds to execute the run command. - /// Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. - /// Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter. - /// User-assigned managed identity that has access to outputBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. - /// User-assigned managed identity that has access to errorBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. - /// The provisioning state, which only appears in the response. - /// The machine run command instance view. - /// A new instance for mocking. - public static MachineRunCommandData MachineRunCommandData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, MachineRunCommandScriptSource source = null, IEnumerable parameters = null, IEnumerable protectedParameters = null, bool? asyncExecution = null, string runAsUser = null, string runAsPassword = null, int? timeoutInSeconds = null, Uri outputBlobUri = null, Uri errorBlobUri = null, RunCommandManagedIdentity outputBlobManagedIdentity = null, RunCommandManagedIdentity errorBlobManagedIdentity = null, string provisioningState = null, MachineRunCommandInstanceView instanceView = null) - { - tags ??= new Dictionary(); - parameters ??= new List(); - protectedParameters ??= new List(); - - return new MachineRunCommandData( - id, - name, - resourceType, - systemData, - tags, - location, - source, - parameters?.ToList(), - protectedParameters?.ToList(), - asyncExecution, - runAsUser, - runAsPassword, - timeoutInSeconds, - outputBlobUri, - errorBlobUri, - outputBlobManagedIdentity, - errorBlobManagedIdentity, - provisioningState, - instanceView, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// Script execution status. - /// Communicate script configuration errors or execution messages. - /// Exit code returned from script execution. - /// Script output stream. - /// Script error stream. - /// Script start time. - /// Script end time. - /// The status information. - /// A new instance for mocking. - public static MachineRunCommandInstanceView MachineRunCommandInstanceView(HybridComputeExecutionState? executionState = null, string executionMessage = null, int? exitCode = null, string output = null, string error = null, DateTimeOffset? startOn = null, DateTimeOffset? endOn = null, IEnumerable statuses = null) - { - statuses ??= new List(); - - return new MachineRunCommandInstanceView( - executionState, - executionMessage, - exitCode, - output, - error, - startOn, - endOn, - statuses?.ToList(), - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The status code. - /// The level code. - /// The short localizable label for the status. - /// The detailed status message, including for alerts and error messages. - /// The time of the status. - /// A new instance for mocking. - public static ExtensionsResourceStatus ExtensionsResourceStatus(string code = null, ExtensionsStatusLevelType? level = null, string displayStatus = null, string message = null, DateTimeOffset? time = null) - { - return new ExtensionsResourceStatus( - code, - level, - displayStatus, - message, - time, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The provisioning state, which only appears in the response. - /// A unique, immutable, identifier for the Gateway. - /// The type of the Gateway resource. - /// The endpoint fqdn for the Gateway. - /// Specifies the list of features that are enabled for this Gateway. - /// A new instance for mocking. - public static HybridComputeGatewayData HybridComputeGatewayData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, HybridComputeProvisioningState? provisioningState = null, string gatewayId = null, HybridComputeGatewayType? gatewayType = null, string gatewayEndpoint = null, IEnumerable allowedFeatures = null) - { - tags ??= new Dictionary(); - allowedFeatures ??= new List(); - - return new HybridComputeGatewayData( - id, - name, - resourceType, - systemData, - tags, - location, - provisioningState, - gatewayId, - gatewayType, - gatewayEndpoint, - allowedFeatures?.ToList(), - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Azure resource tenant Id. - /// Associated Gateway Resource Id. - /// A new instance for mocking. - public static HybridComputeTargetResourceSettings HybridComputeTargetResourceSettings(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, Guid? tenantId = null, ResourceIdentifier gatewayResourceId = null) - { - return new HybridComputeTargetResourceSettings( - id, - name, - resourceType, - systemData, - tenantId, - gatewayResourceId, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The id. /// The name. @@ -1004,5 +913,13 @@ public static NetworkSecurityPerimeterProfile NetworkSecurityPerimeterProfile(st enabledLogCategories?.ToList(), serializedAdditionalRawData: null); } + + /// Initializes a new instance of . + /// The URL of the resource used to check the status of the asynchronous operation. + /// A new instance for mocking. + public static NetworkSecurityPerimeterConfigurationReconcileResult NetworkSecurityPerimeterConfigurationReconcileResult(AzureLocation? location = null) + { + return new NetworkSecurityPerimeterConfigurationReconcileResult(location, serializedAdditionalRawData: null); + } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/HybridComputeExtensions.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/HybridComputeExtensions.cs index ee672734bf273..25563806cb0e1 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/HybridComputeExtensions.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/HybridComputeExtensions.cs @@ -72,79 +72,60 @@ public static HybridComputeMachineResource GetHybridComputeMachineResource(this } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static HybridComputeMachineExtensionResource GetHybridComputeMachineExtensionResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static LicenseProfileResource GetLicenseProfileResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableHybridComputeArmClient(client).GetHybridComputeMachineExtensionResource(id); + return GetMockableHybridComputeArmClient(client).GetLicenseProfileResource(id); } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The resource ID of the resource to get. - /// is null. - /// Returns a object. - public static HybridComputeExtensionValueResource GetHybridComputeExtensionValueResource(this ArmClient client, ResourceIdentifier id) - { - Argument.AssertNotNull(client, nameof(client)); - - return GetMockableHybridComputeArmClient(client).GetHybridComputeExtensionValueResource(id); - } - - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static MachineRunCommandResource GetMachineRunCommandResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static HybridComputeMachineExtensionResource GetHybridComputeMachineExtensionResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableHybridComputeArmClient(client).GetMachineRunCommandResource(id); + return GetMockableHybridComputeArmClient(client).GetHybridComputeMachineExtensionResource(id); } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static HybridComputeGatewayResource GetHybridComputeGatewayResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static HybridComputeExtensionValueResource GetHybridComputeExtensionValueResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableHybridComputeArmClient(client).GetHybridComputeGatewayResource(id); + return GetMockableHybridComputeArmClient(client).GetHybridComputeExtensionValueResource(id); } /// @@ -253,7 +234,7 @@ public static HybridComputeLicenseCollection GetHybridComputeLicenses(this Resou /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -291,7 +272,7 @@ public static async Task> GetHybridComput /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -346,7 +327,7 @@ public static HybridComputeMachineCollection GetHybridComputeMachines(this Resou /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -385,7 +366,7 @@ public static async Task> GetHybridComput /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -411,99 +392,6 @@ public static Response GetHybridComputeMachine(thi return GetMockableHybridComputeResourceGroupResource(resourceGroupResource).GetHybridComputeMachine(machineName, expand, cancellationToken); } - /// - /// Gets a collection of HybridComputeGatewayResources in the ResourceGroupResource. - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// is null. - /// An object representing collection of HybridComputeGatewayResources and their operations over a HybridComputeGatewayResource. - public static HybridComputeGatewayCollection GetHybridComputeGateways(this ResourceGroupResource resourceGroupResource) - { - Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - - return GetMockableHybridComputeResourceGroupResource(resourceGroupResource).GetHybridComputeGateways(); - } - - /// - /// Retrieves information about the view of a gateway. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} - /// - /// - /// Operation Id - /// Gateways_Get - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The name of the Gateway. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public static async Task> GetHybridComputeGatewayAsync(this ResourceGroupResource resourceGroupResource, string gatewayName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - - return await GetMockableHybridComputeResourceGroupResource(resourceGroupResource).GetHybridComputeGatewayAsync(gatewayName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Retrieves information about the view of a gateway. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} - /// - /// - /// Operation Id - /// Gateways_Get - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The name of the Gateway. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public static Response GetHybridComputeGateway(this ResourceGroupResource resourceGroupResource, string gatewayName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - - return GetMockableHybridComputeResourceGroupResource(resourceGroupResource).GetHybridComputeGateway(gatewayName, cancellationToken); - } - /// /// Gets a collection of HybridComputePrivateLinkScopeResources in the ResourceGroupResource. /// @@ -534,7 +422,7 @@ public static HybridComputePrivateLinkScopeCollection GetHybridComputePrivateLin /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -572,7 +460,7 @@ public static async Task> GetHyb /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -597,80 +485,6 @@ public static Response GetHybridComputePr return GetMockableHybridComputeResourceGroupResource(resourceGroupResource).GetHybridComputePrivateLinkScope(scopeName, cancellationToken); } - /// - /// Updates the base Settings of the target resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{baseProvider}/{baseResourceType}/{baseResourceName}/providers/Microsoft.HybridCompute/settings/{settingsResourceName} - /// - /// - /// Operation Id - /// Settings_Update - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The name of the base Resource Provider. - /// The name of the base Resource Type. - /// The name of the base resource. - /// The name of the settings resource. - /// Settings details. - /// The cancellation token to use. - /// , , or is an empty string, and was expected to be non-empty. - /// , , , , or is null. - public static async Task> UpdateTargetResourceSettingAsync(this ResourceGroupResource resourceGroupResource, string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, HybridComputeTargetResourceSettings hybridComputeTargetResourceSettings, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - - return await GetMockableHybridComputeResourceGroupResource(resourceGroupResource).UpdateTargetResourceSettingAsync(baseProvider, baseResourceType, baseResourceName, settingsResourceName, hybridComputeTargetResourceSettings, cancellationToken).ConfigureAwait(false); - } - - /// - /// Updates the base Settings of the target resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{baseProvider}/{baseResourceType}/{baseResourceName}/providers/Microsoft.HybridCompute/settings/{settingsResourceName} - /// - /// - /// Operation Id - /// Settings_Update - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// - /// Mocking - /// To mock this method, please mock instead. - /// - /// - /// The instance the method will execute against. - /// The name of the base Resource Provider. - /// The name of the base Resource Type. - /// The name of the base resource. - /// The name of the settings resource. - /// Settings details. - /// The cancellation token to use. - /// , , or is an empty string, and was expected to be non-empty. - /// , , , , or is null. - public static Response UpdateTargetResourceSetting(this ResourceGroupResource resourceGroupResource, string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, HybridComputeTargetResourceSettings hybridComputeTargetResourceSettings, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - - return GetMockableHybridComputeResourceGroupResource(resourceGroupResource).UpdateTargetResourceSetting(baseProvider, baseResourceType, baseResourceName, settingsResourceName, hybridComputeTargetResourceSettings, cancellationToken); - } - /// /// Gets a collection of HybridComputeExtensionValueResources in the SubscriptionResource. /// @@ -705,7 +519,7 @@ public static HybridComputeExtensionValueCollection GetHybridComputeExtensionVal /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -746,7 +560,7 @@ public static async Task> GetHybri /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -775,19 +589,19 @@ public static Response GetHybridComputeExte } /// - /// The operation to get all licenses of a non-Azure machine + /// The operation to validate a license. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/licenses + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/validateLicense /// /// /// Operation Id - /// Licenses_ListBySubscription + /// Licenses_ValidateLicense /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -796,34 +610,35 @@ public static Response GetHybridComputeExte /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Parameters supplied to the license validation operation. /// The cancellation token to use. - /// is null. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetHybridComputeLicensesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// or is null. + public static async Task> ValidateLicenseLicenseAsync(this SubscriptionResource subscriptionResource, WaitUntil waitUntil, HybridComputeLicenseData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableHybridComputeSubscriptionResource(subscriptionResource).GetHybridComputeLicensesAsync(cancellationToken); + return await GetMockableHybridComputeSubscriptionResource(subscriptionResource).ValidateLicenseLicenseAsync(waitUntil, data, cancellationToken).ConfigureAwait(false); } /// - /// The operation to get all licenses of a non-Azure machine + /// The operation to validate a license. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/licenses + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/validateLicense /// /// /// Operation Id - /// Licenses_ListBySubscription + /// Licenses_ValidateLicense /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -832,162 +647,163 @@ public static AsyncPageable GetHybridComputeLicens /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Parameters supplied to the license validation operation. /// The cancellation token to use. - /// is null. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetHybridComputeLicenses(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// or is null. + public static ArmOperation ValidateLicenseLicense(this SubscriptionResource subscriptionResource, WaitUntil waitUntil, HybridComputeLicenseData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableHybridComputeSubscriptionResource(subscriptionResource).GetHybridComputeLicenses(cancellationToken); + return GetMockableHybridComputeSubscriptionResource(subscriptionResource).ValidateLicenseLicense(waitUntil, data, cancellationToken); } /// - /// Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next page of hybrid machines. + /// The operation to get all licenses of a non-Azure machine /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/machines + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/licenses /// /// /// Operation Id - /// Machines_ListBySubscription + /// Licenses_ListBySubscription /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The cancellation token to use. /// is null. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetHybridComputeMachinesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetHybridComputeLicensesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableHybridComputeSubscriptionResource(subscriptionResource).GetHybridComputeMachinesAsync(cancellationToken); + return GetMockableHybridComputeSubscriptionResource(subscriptionResource).GetHybridComputeLicensesAsync(cancellationToken); } /// - /// Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next page of hybrid machines. + /// The operation to get all licenses of a non-Azure machine /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/machines + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/licenses /// /// /// Operation Id - /// Machines_ListBySubscription + /// Licenses_ListBySubscription /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The cancellation token to use. /// is null. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetHybridComputeMachines(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetHybridComputeLicenses(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableHybridComputeSubscriptionResource(subscriptionResource).GetHybridComputeMachines(cancellationToken); + return GetMockableHybridComputeSubscriptionResource(subscriptionResource).GetHybridComputeLicenses(cancellationToken); } /// - /// The operation to get all gateways of a non-Azure machine + /// Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next page of hybrid machines. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/gateways + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/machines /// /// /// Operation Id - /// Gateways_ListBySubscription + /// Machines_ListBySubscription /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The cancellation token to use. /// is null. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetHybridComputeGatewaysAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetHybridComputeMachinesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableHybridComputeSubscriptionResource(subscriptionResource).GetHybridComputeGatewaysAsync(cancellationToken); + return GetMockableHybridComputeSubscriptionResource(subscriptionResource).GetHybridComputeMachinesAsync(cancellationToken); } /// - /// The operation to get all gateways of a non-Azure machine + /// Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next page of hybrid machines. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/gateways + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/machines /// /// /// Operation Id - /// Gateways_ListBySubscription + /// Machines_ListBySubscription /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The cancellation token to use. /// is null. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetHybridComputeGateways(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetHybridComputeMachines(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableHybridComputeSubscriptionResource(subscriptionResource).GetHybridComputeGateways(cancellationToken); + return GetMockableHybridComputeSubscriptionResource(subscriptionResource).GetHybridComputeMachines(cancellationToken); } /// @@ -1003,7 +819,7 @@ public static Pageable GetHybridComputeGateways(th /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -1039,7 +855,7 @@ public static AsyncPageable GetHybridComp /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -1075,7 +891,7 @@ public static Pageable GetHybridComputePr /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -1113,7 +929,7 @@ public static async Task> GetValidat /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeArmClient.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeArmClient.cs index 9c6cb94a5bdd3..cc5eb1671025c 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeArmClient.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeArmClient.cs @@ -58,6 +58,18 @@ public virtual HybridComputeMachineResource GetHybridComputeMachineResource(Reso return new HybridComputeMachineResource(Client, id); } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual LicenseProfileResource GetLicenseProfileResource(ResourceIdentifier id) + { + LicenseProfileResource.ValidateResourceId(id); + return new LicenseProfileResource(Client, id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -82,30 +94,6 @@ public virtual HybridComputeExtensionValueResource GetHybridComputeExtensionValu return new HybridComputeExtensionValueResource(Client, id); } - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual MachineRunCommandResource GetMachineRunCommandResource(ResourceIdentifier id) - { - MachineRunCommandResource.ValidateResourceId(id); - return new MachineRunCommandResource(Client, id); - } - - /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. - /// - /// The resource ID of the resource to get. - /// Returns a object. - public virtual HybridComputeGatewayResource GetHybridComputeGatewayResource(ResourceIdentifier id) - { - HybridComputeGatewayResource.ValidateResourceId(id); - return new HybridComputeGatewayResource(Client, id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeResourceGroupResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeResourceGroupResource.cs index 187e7f2205d96..475986939d068 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeResourceGroupResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeResourceGroupResource.cs @@ -9,17 +9,12 @@ using System.Threading; using System.Threading.Tasks; using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.HybridCompute.Models; namespace Azure.ResourceManager.HybridCompute.Mocking { /// A class to add extension methods to ResourceGroupResource. public partial class MockableHybridComputeResourceGroupResource : ArmResource { - private ClientDiagnostics _settingsClientDiagnostics; - private SettingsRestOperations _settingsRestClient; - /// Initializes a new instance of the class for mocking. protected MockableHybridComputeResourceGroupResource() { @@ -32,9 +27,6 @@ internal MockableHybridComputeResourceGroupResource(ArmClient client, ResourceId { } - private ClientDiagnostics SettingsClientDiagnostics => _settingsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.HybridCompute", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private SettingsRestOperations SettingsRestClient => _settingsRestClient ??= new SettingsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private string GetApiVersionOrNull(ResourceType resourceType) { TryGetApiVersion(resourceType, out string apiVersion); @@ -61,7 +53,7 @@ public virtual HybridComputeLicenseCollection GetHybridComputeLicenses() /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -92,7 +84,7 @@ public virtual async Task> GetHybridCompu /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -130,7 +122,7 @@ public virtual HybridComputeMachineCollection GetHybridComputeMachines() /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -162,7 +154,7 @@ public virtual async Task> GetHybridCompu /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -181,75 +173,6 @@ public virtual Response GetHybridComputeMachine(st return GetHybridComputeMachines().Get(machineName, expand, cancellationToken); } - /// Gets a collection of HybridComputeGatewayResources in the ResourceGroupResource. - /// An object representing collection of HybridComputeGatewayResources and their operations over a HybridComputeGatewayResource. - public virtual HybridComputeGatewayCollection GetHybridComputeGateways() - { - return GetCachedClient(client => new HybridComputeGatewayCollection(client, Id)); - } - - /// - /// Retrieves information about the view of a gateway. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} - /// - /// - /// Operation Id - /// Gateways_Get - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the Gateway. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetHybridComputeGatewayAsync(string gatewayName, CancellationToken cancellationToken = default) - { - return await GetHybridComputeGateways().GetAsync(gatewayName, cancellationToken).ConfigureAwait(false); - } - - /// - /// Retrieves information about the view of a gateway. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} - /// - /// - /// Operation Id - /// Gateways_Get - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the Gateway. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetHybridComputeGateway(string gatewayName, CancellationToken cancellationToken = default) - { - return GetHybridComputeGateways().Get(gatewayName, cancellationToken); - } - /// Gets a collection of HybridComputePrivateLinkScopeResources in the ResourceGroupResource. /// An object representing collection of HybridComputePrivateLinkScopeResources and their operations over a HybridComputePrivateLinkScopeResource. public virtual HybridComputePrivateLinkScopeCollection GetHybridComputePrivateLinkScopes() @@ -270,7 +193,7 @@ public virtual HybridComputePrivateLinkScopeCollection GetHybridComputePrivateLi /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -301,7 +224,7 @@ public virtual async Task> GetHy /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -318,99 +241,5 @@ public virtual Response GetHybridComputeP { return GetHybridComputePrivateLinkScopes().Get(scopeName, cancellationToken); } - - /// - /// Updates the base Settings of the target resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{baseProvider}/{baseResourceType}/{baseResourceName}/providers/Microsoft.HybridCompute/settings/{settingsResourceName} - /// - /// - /// Operation Id - /// Settings_Update - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// - /// The name of the base Resource Provider. - /// The name of the base Resource Type. - /// The name of the base resource. - /// The name of the settings resource. - /// Settings details. - /// The cancellation token to use. - /// , , or is an empty string, and was expected to be non-empty. - /// , , , or is null. - public virtual async Task> UpdateTargetResourceSettingAsync(string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, HybridComputeTargetResourceSettings hybridComputeTargetResourceSettings, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(baseProvider, nameof(baseProvider)); - Argument.AssertNotNullOrEmpty(baseResourceType, nameof(baseResourceType)); - Argument.AssertNotNullOrEmpty(baseResourceName, nameof(baseResourceName)); - Argument.AssertNotNullOrEmpty(settingsResourceName, nameof(settingsResourceName)); - Argument.AssertNotNull(hybridComputeTargetResourceSettings, nameof(hybridComputeTargetResourceSettings)); - - using var scope = SettingsClientDiagnostics.CreateScope("MockableHybridComputeResourceGroupResource.UpdateTargetResourceSetting"); - scope.Start(); - try - { - var response = await SettingsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, baseProvider, baseResourceType, baseResourceName, settingsResourceName, hybridComputeTargetResourceSettings, cancellationToken).ConfigureAwait(false); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Updates the base Settings of the target resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{baseProvider}/{baseResourceType}/{baseResourceName}/providers/Microsoft.HybridCompute/settings/{settingsResourceName} - /// - /// - /// Operation Id - /// Settings_Update - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// - /// The name of the base Resource Provider. - /// The name of the base Resource Type. - /// The name of the base resource. - /// The name of the settings resource. - /// Settings details. - /// The cancellation token to use. - /// , , or is an empty string, and was expected to be non-empty. - /// , , , or is null. - public virtual Response UpdateTargetResourceSetting(string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, HybridComputeTargetResourceSettings hybridComputeTargetResourceSettings, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(baseProvider, nameof(baseProvider)); - Argument.AssertNotNullOrEmpty(baseResourceType, nameof(baseResourceType)); - Argument.AssertNotNullOrEmpty(baseResourceName, nameof(baseResourceName)); - Argument.AssertNotNullOrEmpty(settingsResourceName, nameof(settingsResourceName)); - Argument.AssertNotNull(hybridComputeTargetResourceSettings, nameof(hybridComputeTargetResourceSettings)); - - using var scope = SettingsClientDiagnostics.CreateScope("MockableHybridComputeResourceGroupResource.UpdateTargetResourceSetting"); - scope.Start(); - try - { - var response = SettingsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, baseProvider, baseResourceType, baseResourceName, settingsResourceName, hybridComputeTargetResourceSettings, cancellationToken); - return response; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeSubscriptionResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeSubscriptionResource.cs index adeda6adbf35e..59489434be508 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeSubscriptionResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeSubscriptionResource.cs @@ -22,8 +22,6 @@ public partial class MockableHybridComputeSubscriptionResource : ArmResource private LicensesRestOperations _hybridComputeLicenseLicensesRestClient; private ClientDiagnostics _hybridComputeMachineMachinesClientDiagnostics; private MachinesRestOperations _hybridComputeMachineMachinesRestClient; - private ClientDiagnostics _hybridComputeGatewayGatewaysClientDiagnostics; - private GatewaysRestOperations _hybridComputeGatewayGatewaysRestClient; private ClientDiagnostics _hybridComputePrivateLinkScopePrivateLinkScopesClientDiagnostics; private PrivateLinkScopesRestOperations _hybridComputePrivateLinkScopePrivateLinkScopesRestClient; @@ -43,8 +41,6 @@ internal MockableHybridComputeSubscriptionResource(ArmClient client, ResourceIde private LicensesRestOperations HybridComputeLicenseLicensesRestClient => _hybridComputeLicenseLicensesRestClient ??= new LicensesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(HybridComputeLicenseResource.ResourceType)); private ClientDiagnostics HybridComputeMachineMachinesClientDiagnostics => _hybridComputeMachineMachinesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.HybridCompute", HybridComputeMachineResource.ResourceType.Namespace, Diagnostics); private MachinesRestOperations HybridComputeMachineMachinesRestClient => _hybridComputeMachineMachinesRestClient ??= new MachinesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(HybridComputeMachineResource.ResourceType)); - private ClientDiagnostics HybridComputeGatewayGatewaysClientDiagnostics => _hybridComputeGatewayGatewaysClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.HybridCompute", HybridComputeGatewayResource.ResourceType.Namespace, Diagnostics); - private GatewaysRestOperations HybridComputeGatewayGatewaysRestClient => _hybridComputeGatewayGatewaysRestClient ??= new GatewaysRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(HybridComputeGatewayResource.ResourceType)); private ClientDiagnostics HybridComputePrivateLinkScopePrivateLinkScopesClientDiagnostics => _hybridComputePrivateLinkScopePrivateLinkScopesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.HybridCompute", HybridComputePrivateLinkScopeResource.ResourceType.Namespace, Diagnostics); private PrivateLinkScopesRestOperations HybridComputePrivateLinkScopePrivateLinkScopesRestClient => _hybridComputePrivateLinkScopePrivateLinkScopesRestClient ??= new PrivateLinkScopesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(HybridComputePrivateLinkScopeResource.ResourceType)); @@ -79,7 +75,7 @@ public virtual HybridComputeExtensionValueCollection GetHybridComputeExtensionVa /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -113,7 +109,7 @@ public virtual async Task> GetHybr /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -135,19 +131,19 @@ public virtual Response GetHybridComputeExt } /// - /// The operation to get all licenses of a non-Azure machine + /// The operation to validate a license. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/licenses + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/validateLicense /// /// /// Operation Id - /// Licenses_ListBySubscription + /// Licenses_ValidateLicense /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -155,29 +151,45 @@ public virtual Response GetHybridComputeExt /// /// /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Parameters supplied to the license validation operation. /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetHybridComputeLicensesAsync(CancellationToken cancellationToken = default) + /// is null. + public virtual async Task> ValidateLicenseLicenseAsync(WaitUntil waitUntil, HybridComputeLicenseData data, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => HybridComputeLicenseLicensesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => HybridComputeLicenseLicensesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HybridComputeLicenseResource(Client, HybridComputeLicenseData.DeserializeHybridComputeLicenseData(e)), HybridComputeLicenseLicensesClientDiagnostics, Pipeline, "MockableHybridComputeSubscriptionResource.GetHybridComputeLicenses", "value", "nextLink", cancellationToken); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = HybridComputeLicenseLicensesClientDiagnostics.CreateScope("MockableHybridComputeSubscriptionResource.ValidateLicenseLicense"); + scope.Start(); + try + { + var response = await HybridComputeLicenseLicensesRestClient.ValidateLicenseAsync(Id.SubscriptionId, data, cancellationToken).ConfigureAwait(false); + var operation = new HybridComputeArmOperation(new HybridComputeLicenseOperationSource(Client), HybridComputeLicenseLicensesClientDiagnostics, Pipeline, HybridComputeLicenseLicensesRestClient.CreateValidateLicenseRequest(Id.SubscriptionId, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } } /// - /// The operation to get all licenses of a non-Azure machine + /// The operation to validate a license. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/licenses + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/validateLicense /// /// /// Operation Id - /// Licenses_ListBySubscription + /// Licenses_ValidateLicense /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -185,133 +197,149 @@ public virtual AsyncPageable GetHybridComputeLicen /// /// /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Parameters supplied to the license validation operation. /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetHybridComputeLicenses(CancellationToken cancellationToken = default) + /// is null. + public virtual ArmOperation ValidateLicenseLicense(WaitUntil waitUntil, HybridComputeLicenseData data, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => HybridComputeLicenseLicensesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => HybridComputeLicenseLicensesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HybridComputeLicenseResource(Client, HybridComputeLicenseData.DeserializeHybridComputeLicenseData(e)), HybridComputeLicenseLicensesClientDiagnostics, Pipeline, "MockableHybridComputeSubscriptionResource.GetHybridComputeLicenses", "value", "nextLink", cancellationToken); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = HybridComputeLicenseLicensesClientDiagnostics.CreateScope("MockableHybridComputeSubscriptionResource.ValidateLicenseLicense"); + scope.Start(); + try + { + var response = HybridComputeLicenseLicensesRestClient.ValidateLicense(Id.SubscriptionId, data, cancellationToken); + var operation = new HybridComputeArmOperation(new HybridComputeLicenseOperationSource(Client), HybridComputeLicenseLicensesClientDiagnostics, Pipeline, HybridComputeLicenseLicensesRestClient.CreateValidateLicenseRequest(Id.SubscriptionId, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } } /// - /// Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next page of hybrid machines. + /// The operation to get all licenses of a non-Azure machine /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/machines + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/licenses /// /// /// Operation Id - /// Machines_ListBySubscription + /// Licenses_ListBySubscription /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetHybridComputeMachinesAsync(CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetHybridComputeLicensesAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => HybridComputeMachineMachinesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => HybridComputeMachineMachinesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HybridComputeMachineResource(Client, HybridComputeMachineData.DeserializeHybridComputeMachineData(e)), HybridComputeMachineMachinesClientDiagnostics, Pipeline, "MockableHybridComputeSubscriptionResource.GetHybridComputeMachines", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => HybridComputeLicenseLicensesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => HybridComputeLicenseLicensesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HybridComputeLicenseResource(Client, HybridComputeLicenseData.DeserializeHybridComputeLicenseData(e)), HybridComputeLicenseLicensesClientDiagnostics, Pipeline, "MockableHybridComputeSubscriptionResource.GetHybridComputeLicenses", "value", "nextLink", cancellationToken); } /// - /// Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next page of hybrid machines. + /// The operation to get all licenses of a non-Azure machine /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/machines + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/licenses /// /// /// Operation Id - /// Machines_ListBySubscription + /// Licenses_ListBySubscription /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetHybridComputeMachines(CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetHybridComputeLicenses(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => HybridComputeMachineMachinesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => HybridComputeMachineMachinesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HybridComputeMachineResource(Client, HybridComputeMachineData.DeserializeHybridComputeMachineData(e)), HybridComputeMachineMachinesClientDiagnostics, Pipeline, "MockableHybridComputeSubscriptionResource.GetHybridComputeMachines", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => HybridComputeLicenseLicensesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => HybridComputeLicenseLicensesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HybridComputeLicenseResource(Client, HybridComputeLicenseData.DeserializeHybridComputeLicenseData(e)), HybridComputeLicenseLicensesClientDiagnostics, Pipeline, "MockableHybridComputeSubscriptionResource.GetHybridComputeLicenses", "value", "nextLink", cancellationToken); } /// - /// The operation to get all gateways of a non-Azure machine + /// Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next page of hybrid machines. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/gateways + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/machines /// /// /// Operation Id - /// Gateways_ListBySubscription + /// Machines_ListBySubscription /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetHybridComputeGatewaysAsync(CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetHybridComputeMachinesAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => HybridComputeGatewayGatewaysRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => HybridComputeGatewayGatewaysRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HybridComputeGatewayResource(Client, HybridComputeGatewayData.DeserializeHybridComputeGatewayData(e)), HybridComputeGatewayGatewaysClientDiagnostics, Pipeline, "MockableHybridComputeSubscriptionResource.GetHybridComputeGateways", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => HybridComputeMachineMachinesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => HybridComputeMachineMachinesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HybridComputeMachineResource(Client, HybridComputeMachineData.DeserializeHybridComputeMachineData(e)), HybridComputeMachineMachinesClientDiagnostics, Pipeline, "MockableHybridComputeSubscriptionResource.GetHybridComputeMachines", "value", "nextLink", cancellationToken); } /// - /// The operation to get all gateways of a non-Azure machine + /// Lists all the hybrid machines in the specified subscription. Use the nextLink property in the response to get the next page of hybrid machines. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/gateways + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/machines /// /// /// Operation Id - /// Gateways_ListBySubscription + /// Machines_ListBySubscription /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetHybridComputeGateways(CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetHybridComputeMachines(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => HybridComputeGatewayGatewaysRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => HybridComputeGatewayGatewaysRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HybridComputeGatewayResource(Client, HybridComputeGatewayData.DeserializeHybridComputeGatewayData(e)), HybridComputeGatewayGatewaysClientDiagnostics, Pipeline, "MockableHybridComputeSubscriptionResource.GetHybridComputeGateways", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => HybridComputeMachineMachinesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => HybridComputeMachineMachinesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HybridComputeMachineResource(Client, HybridComputeMachineData.DeserializeHybridComputeMachineData(e)), HybridComputeMachineMachinesClientDiagnostics, Pipeline, "MockableHybridComputeSubscriptionResource.GetHybridComputeMachines", "value", "nextLink", cancellationToken); } /// @@ -327,7 +355,7 @@ public virtual Pageable GetHybridComputeGateways(C /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -357,7 +385,7 @@ public virtual AsyncPageable GetHybridCom /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -387,7 +415,7 @@ public virtual Pageable GetHybridComputeP /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -431,7 +459,7 @@ public virtual async Task> GetValida /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeExtensionValueCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeExtensionValueCollection.cs index 805cb45af6ba4..538d5f7ffa10a 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeExtensionValueCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeExtensionValueCollection.cs @@ -76,7 +76,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -121,7 +121,7 @@ public virtual async Task> GetAsyn /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -166,7 +166,7 @@ public virtual Response Get(string version, /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -195,7 +195,7 @@ public virtual AsyncPageable GetAllAsync(Ca /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -224,7 +224,7 @@ public virtual Pageable GetAll(Cancellation /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -267,7 +267,7 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -310,7 +310,7 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeExtensionValueData.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeExtensionValueData.cs index 5e9928bfe1b59..d5a7d035dd892 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeExtensionValueData.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeExtensionValueData.cs @@ -51,7 +51,7 @@ public partial class HybridComputeExtensionValueData : ResourceData private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - public HybridComputeExtensionValueData() + internal HybridComputeExtensionValueData() { } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeExtensionValueResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeExtensionValueResource.cs index 190328fd514ca..15b320990465c 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeExtensionValueResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeExtensionValueResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsyn /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeGatewayCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeGatewayCollection.cs deleted file mode 100644 index 9a0133660896f..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeGatewayCollection.cs +++ /dev/null @@ -1,494 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.HybridCompute -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetHybridComputeGateways method from an instance of . - /// - public partial class HybridComputeGatewayCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _hybridComputeGatewayGatewaysClientDiagnostics; - private readonly GatewaysRestOperations _hybridComputeGatewayGatewaysRestClient; - - /// Initializes a new instance of the class for mocking. - protected HybridComputeGatewayCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal HybridComputeGatewayCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _hybridComputeGatewayGatewaysClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridCompute", HybridComputeGatewayResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(HybridComputeGatewayResource.ResourceType, out string hybridComputeGatewayGatewaysApiVersion); - _hybridComputeGatewayGatewaysRestClient = new GatewaysRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, hybridComputeGatewayGatewaysApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceGroupResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); - } - - /// - /// The operation to create or update a gateway. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} - /// - /// - /// Operation Id - /// Gateways_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the Gateway. - /// Parameters supplied to the Create gateway operation. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string gatewayName, HybridComputeGatewayData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _hybridComputeGatewayGatewaysRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, data, cancellationToken).ConfigureAwait(false); - var operation = new HybridComputeArmOperation(new HybridComputeGatewayOperationSource(Client), _hybridComputeGatewayGatewaysClientDiagnostics, Pipeline, _hybridComputeGatewayGatewaysRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// The operation to create or update a gateway. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} - /// - /// - /// Operation Id - /// Gateways_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the Gateway. - /// Parameters supplied to the Create gateway operation. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string gatewayName, HybridComputeGatewayData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _hybridComputeGatewayGatewaysRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, data, cancellationToken); - var operation = new HybridComputeArmOperation(new HybridComputeGatewayOperationSource(Client), _hybridComputeGatewayGatewaysClientDiagnostics, Pipeline, _hybridComputeGatewayGatewaysRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, data).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieves information about the view of a gateway. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} - /// - /// - /// Operation Id - /// Gateways_Get - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the Gateway. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string gatewayName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); - - using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayCollection.Get"); - scope.Start(); - try - { - var response = await _hybridComputeGatewayGatewaysRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new HybridComputeGatewayResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieves information about the view of a gateway. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} - /// - /// - /// Operation Id - /// Gateways_Get - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the Gateway. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string gatewayName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); - - using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayCollection.Get"); - scope.Start(); - try - { - var response = _hybridComputeGatewayGatewaysRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new HybridComputeGatewayResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// The operation to get all gateways of a non-Azure machine - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways - /// - /// - /// Operation Id - /// Gateways_ListByResourceGroup - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _hybridComputeGatewayGatewaysRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _hybridComputeGatewayGatewaysRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HybridComputeGatewayResource(Client, HybridComputeGatewayData.DeserializeHybridComputeGatewayData(e)), _hybridComputeGatewayGatewaysClientDiagnostics, Pipeline, "HybridComputeGatewayCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// The operation to get all gateways of a non-Azure machine - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways - /// - /// - /// Operation Id - /// Gateways_ListByResourceGroup - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _hybridComputeGatewayGatewaysRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _hybridComputeGatewayGatewaysRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HybridComputeGatewayResource(Client, HybridComputeGatewayData.DeserializeHybridComputeGatewayData(e)), _hybridComputeGatewayGatewaysClientDiagnostics, Pipeline, "HybridComputeGatewayCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} - /// - /// - /// Operation Id - /// Gateways_Get - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the Gateway. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string gatewayName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); - - using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayCollection.Exists"); - scope.Start(); - try - { - var response = await _hybridComputeGatewayGatewaysRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} - /// - /// - /// Operation Id - /// Gateways_Get - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the Gateway. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string gatewayName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); - - using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayCollection.Exists"); - scope.Start(); - try - { - var response = _hybridComputeGatewayGatewaysRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} - /// - /// - /// Operation Id - /// Gateways_Get - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the Gateway. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string gatewayName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); - - using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _hybridComputeGatewayGatewaysRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new HybridComputeGatewayResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} - /// - /// - /// Operation Id - /// Gateways_Get - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the Gateway. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string gatewayName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); - - using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayCollection.GetIfExists"); - scope.Start(); - try - { - var response = _hybridComputeGatewayGatewaysRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new HybridComputeGatewayResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeGatewayData.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeGatewayData.Serialization.cs deleted file mode 100644 index 11772b20cf5c8..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeGatewayData.Serialization.cs +++ /dev/null @@ -1,495 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.HybridCompute.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.HybridCompute -{ - public partial class HybridComputeGatewayData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(HybridComputeGatewayData)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(GatewayId)) - { - writer.WritePropertyName("gatewayId"u8); - writer.WriteStringValue(GatewayId); - } - if (Optional.IsDefined(GatewayType)) - { - writer.WritePropertyName("gatewayType"u8); - writer.WriteStringValue(GatewayType.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(GatewayEndpoint)) - { - writer.WritePropertyName("gatewayEndpoint"u8); - writer.WriteStringValue(GatewayEndpoint); - } - if (Optional.IsCollectionDefined(AllowedFeatures)) - { - writer.WritePropertyName("allowedFeatures"u8); - writer.WriteStartArray(); - foreach (var item in AllowedFeatures) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - } - - HybridComputeGatewayData 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(HybridComputeGatewayData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeHybridComputeGatewayData(document.RootElement, options); - } - - internal static HybridComputeGatewayData DeserializeHybridComputeGatewayData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IDictionary tags = default; - AzureLocation location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - HybridComputeProvisioningState? provisioningState = default; - string gatewayId = default; - HybridComputeGatewayType? gatewayType = default; - string gatewayEndpoint = default; - IList allowedFeatures = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("location"u8)) - { - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("provisioningState"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - provisioningState = new HybridComputeProvisioningState(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("gatewayId"u8)) - { - gatewayId = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("gatewayType"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - gatewayType = new HybridComputeGatewayType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("gatewayEndpoint"u8)) - { - gatewayEndpoint = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("allowedFeatures"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - allowedFeatures = array; - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new HybridComputeGatewayData( - id, - name, - type, - systemData, - tags ?? new ChangeTrackingDictionary(), - location, - provisioningState, - gatewayId, - gatewayType, - gatewayEndpoint, - allowedFeatures ?? new ChangeTrackingList(), - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" location: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" location: "); - builder.AppendLine($"'{Location.ToString()}'"); - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" tags: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Tags)) - { - if (Tags.Any()) - { - builder.Append(" tags: "); - builder.AppendLine("{"); - foreach (var item in Tags) - { - builder.Append($" '{item.Key}': "); - if (item.Value == null) - { - builder.Append("null"); - continue; - } - if (item.Value.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{item.Value}'''"); - } - else - { - builder.AppendLine($"'{item.Value}'"); - } - } - builder.AppendLine(" }"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" provisioningState: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ProvisioningState)) - { - builder.Append(" provisioningState: "); - builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(GatewayId), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" gatewayId: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(GatewayId)) - { - builder.Append(" gatewayId: "); - if (GatewayId.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{GatewayId}'''"); - } - else - { - builder.AppendLine($"'{GatewayId}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(GatewayType), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" gatewayType: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(GatewayType)) - { - builder.Append(" gatewayType: "); - builder.AppendLine($"'{GatewayType.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(GatewayEndpoint), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" gatewayEndpoint: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(GatewayEndpoint)) - { - builder.Append(" gatewayEndpoint: "); - if (GatewayEndpoint.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{GatewayEndpoint}'''"); - } - else - { - builder.AppendLine($"'{GatewayEndpoint}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AllowedFeatures), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" allowedFeatures: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(AllowedFeatures)) - { - if (AllowedFeatures.Any()) - { - builder.Append(" allowedFeatures: "); - builder.AppendLine("["); - foreach (var item in AllowedFeatures) - { - if (item == null) - { - builder.Append("null"); - continue; - } - if (item.Contains(Environment.NewLine)) - { - builder.AppendLine(" '''"); - builder.AppendLine($"{item}'''"); - } - else - { - builder.AppendLine($" '{item}'"); - } - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine(" }"); - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(HybridComputeGatewayData)} does not support writing '{options.Format}' format."); - } - } - - HybridComputeGatewayData 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 DeserializeHybridComputeGatewayData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(HybridComputeGatewayData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeGatewayData.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeGatewayData.cs deleted file mode 100644 index f4d567d6c7ef3..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeGatewayData.cs +++ /dev/null @@ -1,105 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.HybridCompute.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.HybridCompute -{ - /// - /// A class representing the HybridComputeGateway data model. - /// Describes an Arc Gateway. - /// - public partial class HybridComputeGatewayData : TrackedResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The location. - public HybridComputeGatewayData(AzureLocation location) : base(location) - { - AllowedFeatures = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The provisioning state, which only appears in the response. - /// A unique, immutable, identifier for the Gateway. - /// The type of the Gateway resource. - /// The endpoint fqdn for the Gateway. - /// Specifies the list of features that are enabled for this Gateway. - /// Keeps track of any properties unknown to the library. - internal HybridComputeGatewayData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, HybridComputeProvisioningState? provisioningState, string gatewayId, HybridComputeGatewayType? gatewayType, string gatewayEndpoint, IList allowedFeatures, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) - { - ProvisioningState = provisioningState; - GatewayId = gatewayId; - GatewayType = gatewayType; - GatewayEndpoint = gatewayEndpoint; - AllowedFeatures = allowedFeatures; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal HybridComputeGatewayData() - { - } - - /// The provisioning state, which only appears in the response. - [WirePath("properties.provisioningState")] - public HybridComputeProvisioningState? ProvisioningState { get; } - /// A unique, immutable, identifier for the Gateway. - [WirePath("properties.gatewayId")] - public string GatewayId { get; } - /// The type of the Gateway resource. - [WirePath("properties.gatewayType")] - public HybridComputeGatewayType? GatewayType { get; set; } - /// The endpoint fqdn for the Gateway. - [WirePath("properties.gatewayEndpoint")] - public string GatewayEndpoint { get; } - /// Specifies the list of features that are enabled for this Gateway. - [WirePath("properties.allowedFeatures")] - public IList AllowedFeatures { get; } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeGatewayResource.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeGatewayResource.Serialization.cs deleted file mode 100644 index 449a75c8fb2e6..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeGatewayResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.HybridCompute -{ - public partial class HybridComputeGatewayResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - HybridComputeGatewayData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - HybridComputeGatewayData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeGatewayResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeGatewayResource.cs deleted file mode 100644 index 341b964fe557b..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeGatewayResource.cs +++ /dev/null @@ -1,699 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.HybridCompute.Models; -using Azure.ResourceManager.Resources; - -namespace Azure.ResourceManager.HybridCompute -{ - /// - /// A Class representing a HybridComputeGateway along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetHybridComputeGatewayResource method. - /// Otherwise you can get one from its parent resource using the GetHybridComputeGateway method. - /// - public partial class HybridComputeGatewayResource : ArmResource - { - /// Generate the resource identifier of a instance. - /// The subscriptionId. - /// The resourceGroupName. - /// The gatewayName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string gatewayName) - { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName}"; - return new ResourceIdentifier(resourceId); - } - - private readonly ClientDiagnostics _hybridComputeGatewayGatewaysClientDiagnostics; - private readonly GatewaysRestOperations _hybridComputeGatewayGatewaysRestClient; - private readonly HybridComputeGatewayData _data; - - /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.HybridCompute/gateways"; - - /// Initializes a new instance of the class for mocking. - protected HybridComputeGatewayResource() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The resource that is the target of operations. - internal HybridComputeGatewayResource(ArmClient client, HybridComputeGatewayData data) : this(client, data.Id) - { - HasData = true; - _data = data; - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the resource that is the target of operations. - internal HybridComputeGatewayResource(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _hybridComputeGatewayGatewaysClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridCompute", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string hybridComputeGatewayGatewaysApiVersion); - _hybridComputeGatewayGatewaysRestClient = new GatewaysRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, hybridComputeGatewayGatewaysApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - /// Gets whether or not the current instance has data. - public virtual bool HasData { get; } - - /// Gets the data representing this Feature. - /// Throws if there is no data loaded in the current instance. - public virtual HybridComputeGatewayData Data - { - get - { - if (!HasData) - throw new InvalidOperationException("The current instance does not have data, you must call Get first."); - return _data; - } - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); - } - - /// - /// Retrieves information about the view of a gateway. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} - /// - /// - /// Operation Id - /// Gateways_Get - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) - { - using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayResource.Get"); - scope.Start(); - try - { - var response = await _hybridComputeGatewayGatewaysRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new HybridComputeGatewayResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Retrieves information about the view of a gateway. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} - /// - /// - /// Operation Id - /// Gateways_Get - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) - { - using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayResource.Get"); - scope.Start(); - try - { - var response = _hybridComputeGatewayGatewaysRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new HybridComputeGatewayResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// The operation to delete a gateway. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} - /// - /// - /// Operation Id - /// Gateways_Delete - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayResource.Delete"); - scope.Start(); - try - { - var response = await _hybridComputeGatewayGatewaysRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new HybridComputeArmOperation(_hybridComputeGatewayGatewaysClientDiagnostics, Pipeline, _hybridComputeGatewayGatewaysRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// The operation to delete a gateway. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} - /// - /// - /// Operation Id - /// Gateways_Delete - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The cancellation token to use. - public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) - { - using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayResource.Delete"); - scope.Start(); - try - { - var response = _hybridComputeGatewayGatewaysRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new HybridComputeArmOperation(_hybridComputeGatewayGatewaysClientDiagnostics, Pipeline, _hybridComputeGatewayGatewaysRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletionResponse(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// The operation to update a gateway. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} - /// - /// - /// Operation Id - /// Gateways_Update - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Parameters supplied to the Update gateway operation. - /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(HybridComputeGatewayPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayResource.Update"); - scope.Start(); - try - { - var response = await _hybridComputeGatewayGatewaysRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new HybridComputeGatewayResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// The operation to update a gateway. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} - /// - /// - /// Operation Id - /// Gateways_Update - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// Parameters supplied to the Update gateway operation. - /// The cancellation token to use. - /// is null. - public virtual Response Update(HybridComputeGatewayPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(patch, nameof(patch)); - - using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayResource.Update"); - scope.Start(); - try - { - var response = _hybridComputeGatewayGatewaysRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); - return Response.FromValue(new HybridComputeGatewayResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} - /// - /// - /// Operation Id - /// Gateways_Get - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The value for the tag. - /// The cancellation token to use. - /// or is null. - public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - Argument.AssertNotNull(value, nameof(value)); - - using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayResource.AddTag"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues[key] = value; - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _hybridComputeGatewayGatewaysRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new HybridComputeGatewayResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new HybridComputeGatewayPatch(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return result; - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Add a tag to the current resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} - /// - /// - /// Operation Id - /// Gateways_Get - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The value for the tag. - /// The cancellation token to use. - /// or is null. - public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - Argument.AssertNotNull(value, nameof(value)); - - using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayResource.AddTag"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues[key] = value; - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _hybridComputeGatewayGatewaysRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new HybridComputeGatewayResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new HybridComputeGatewayPatch(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = Update(patch, cancellationToken: cancellationToken); - return result; - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} - /// - /// - /// Operation Id - /// Gateways_Get - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The set of tags to use as replacement. - /// The cancellation token to use. - /// is null. - public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(tags, nameof(tags)); - - using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayResource.SetTags"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues.ReplaceWith(tags); - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _hybridComputeGatewayGatewaysRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new HybridComputeGatewayResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new HybridComputeGatewayPatch(); - patch.Tags.ReplaceWith(tags); - var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return result; - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Replace the tags on the resource with the given set. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} - /// - /// - /// Operation Id - /// Gateways_Get - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The set of tags to use as replacement. - /// The cancellation token to use. - /// is null. - public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(tags, nameof(tags)); - - using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayResource.SetTags"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues.ReplaceWith(tags); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _hybridComputeGatewayGatewaysRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new HybridComputeGatewayResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new HybridComputeGatewayPatch(); - patch.Tags.ReplaceWith(tags); - var result = Update(patch, cancellationToken: cancellationToken); - return result; - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} - /// - /// - /// Operation Id - /// Gateways_Get - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The cancellation token to use. - /// is null. - public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - - using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayResource.RemoveTag"); - scope.Start(); - try - { - if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) - { - var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); - originalTags.Value.Data.TagValues.Remove(key); - await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _hybridComputeGatewayGatewaysRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new HybridComputeGatewayResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new HybridComputeGatewayPatch(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); - return result; - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Removes a tag by key from the resource. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/gateways/{gatewayName} - /// - /// - /// Operation Id - /// Gateways_Get - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The key for the tag. - /// The cancellation token to use. - /// is null. - public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(key, nameof(key)); - - using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayResource.RemoveTag"); - scope.Start(); - try - { - if (CanUseTagResource(cancellationToken: cancellationToken)) - { - var originalTags = GetTagResource().Get(cancellationToken); - originalTags.Value.Data.TagValues.Remove(key); - GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _hybridComputeGatewayGatewaysRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new HybridComputeGatewayResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); - } - else - { - var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new HybridComputeGatewayPatch(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = Update(patch, cancellationToken: cancellationToken); - return result; - } - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseCollection.cs index 0fc032155a028..52411a343903c 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUp /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUnt /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(strin /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string licenseName, Ca /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(Cancellat /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken c /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string licenseName, Cancel /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string licenseName, CancellationToken cance /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> GetIfE /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseResource.cs index d9b03e64d433f..30dc2a9058996 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(Cance /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken canc /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> UpdateAsyn /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -358,7 +358,7 @@ public virtual ArmOperation Update(WaitUntil waitU /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -415,7 +415,7 @@ public virtual async Task> AddTagAsync(st /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -472,7 +472,7 @@ public virtual Response AddTag(string key, string /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -528,7 +528,7 @@ public virtual async Task> SetTagsAsync(I /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -584,7 +584,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -639,7 +639,7 @@ public virtual async Task> RemoveTagAsync /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineCollection.cs index 4773f96550d2f..6b43a8f2f6da9 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineCollection.cs @@ -52,6 +52,110 @@ internal static void ValidateResourceId(ResourceIdentifier id) throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); } + /// + /// The operation to create or update a hybrid machine. Please note some properties can be set only during machine creation. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName} + /// + /// + /// Operation Id + /// Machines_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-10 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the hybrid machine. + /// Parameters supplied to the Create hybrid machine operation. + /// Expands referenced resources. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string machineName, HybridComputeMachineData data, string expand = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _hybridComputeMachineMachinesClientDiagnostics.CreateScope("HybridComputeMachineCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _hybridComputeMachineMachinesRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, machineName, data, expand, cancellationToken).ConfigureAwait(false); + var uri = _hybridComputeMachineMachinesRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, machineName, data, expand); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new HybridComputeArmOperation(Response.FromValue(new HybridComputeMachineResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// The operation to create or update a hybrid machine. Please note some properties can be set only during machine creation. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName} + /// + /// + /// Operation Id + /// Machines_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-10 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the hybrid machine. + /// Parameters supplied to the Create hybrid machine operation. + /// Expands referenced resources. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string machineName, HybridComputeMachineData data, string expand = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _hybridComputeMachineMachinesClientDiagnostics.CreateScope("HybridComputeMachineCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _hybridComputeMachineMachinesRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, machineName, data, expand, cancellationToken); + var uri = _hybridComputeMachineMachinesRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, machineName, data, expand); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new HybridComputeArmOperation(Response.FromValue(new HybridComputeMachineResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// Retrieves information about the model view or the instance view of a hybrid machine. /// @@ -65,7 +169,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -111,7 +215,7 @@ public virtual async Task> GetAsync(strin /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -157,7 +261,7 @@ public virtual Response Get(string machineName, st /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -188,7 +292,7 @@ public virtual AsyncPageable GetAllAsync(string ex /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -219,7 +323,7 @@ public virtual Pageable GetAll(string expand = nul /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -263,7 +367,7 @@ public virtual async Task> ExistsAsync(string machineName, string /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -307,7 +411,7 @@ public virtual Response Exists(string machineName, string expand = null, C /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -353,7 +457,7 @@ public virtual async Task> GetIfE /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineExtensionCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineExtensionCollection.cs index 738c7626c5e6b..36fbec06c804e 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineExtensionCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineExtensionCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> C /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdat /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAs /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string extens /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync( /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -314,7 +314,7 @@ public virtual Pageable GetAll(string exp /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -357,7 +357,7 @@ public virtual async Task> ExistsAsync(string extensionName, Canc /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -400,7 +400,7 @@ public virtual Response Exists(string extensionName, CancellationToken can /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -445,7 +445,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineExtensionResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineExtensionResource.cs index 4eba82d0e25db..eb5d376240d35 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineExtensionResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineExtensionResource.cs @@ -103,7 +103,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAs /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationT /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -255,7 +255,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel } /// - /// The operation to create or update the extension. + /// The operation to update the extension. /// /// /// Request Path @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -301,7 +301,7 @@ public virtual async Task> U } /// - /// The operation to create or update the extension. + /// The operation to update the extension. /// /// /// Request Path @@ -313,7 +313,7 @@ public virtual async Task> U /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation Update(WaitUn /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -421,7 +421,7 @@ public virtual async Task> AddTa /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -483,7 +483,7 @@ public virtual Response AddTag(string key /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -540,7 +540,7 @@ public virtual async Task> SetTa /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -597,7 +597,7 @@ public virtual Response SetTags(IDictiona /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -657,7 +657,7 @@ public virtual async Task> Remov /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineResource.cs index 1ddc3b882e569..3f97866153e77 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineResource.cs @@ -103,6 +103,13 @@ internal static void ValidateResourceId(ResourceIdentifier id) throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); } + /// Gets an object representing a LicenseProfileResource along with the instance operations that can be performed on it in the HybridComputeMachine. + /// Returns a object. + public virtual LicenseProfileResource GetLicenseProfile() + { + return new LicenseProfileResource(Client, Id.AppendChildResource("licenseProfiles", "default")); + } + /// Gets a collection of HybridComputeMachineExtensionResources in the HybridComputeMachine. /// An object representing collection of HybridComputeMachineExtensionResources and their operations over a HybridComputeMachineExtensionResource. public virtual HybridComputeMachineExtensionCollection GetHybridComputeMachineExtensions() @@ -123,7 +130,7 @@ public virtual HybridComputeMachineExtensionCollection GetHybridComputeMachineEx /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -154,7 +161,7 @@ public virtual async Task> GetHy /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -172,75 +179,6 @@ public virtual Response GetHybridComputeM return GetHybridComputeMachineExtensions().Get(extensionName, cancellationToken); } - /// Gets a collection of MachineRunCommandResources in the HybridComputeMachine. - /// An object representing collection of MachineRunCommandResources and their operations over a MachineRunCommandResource. - public virtual MachineRunCommandCollection GetMachineRunCommands() - { - return GetCachedClient(client => new MachineRunCommandCollection(client, Id)); - } - - /// - /// The operation to get a run command. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} - /// - /// - /// Operation Id - /// MachineRunCommands_Get - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the run command. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual async Task> GetMachineRunCommandAsync(string runCommandName, CancellationToken cancellationToken = default) - { - return await GetMachineRunCommands().GetAsync(runCommandName, cancellationToken).ConfigureAwait(false); - } - - /// - /// The operation to get a run command. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} - /// - /// - /// Operation Id - /// MachineRunCommands_Get - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the run command. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - [ForwardsClientCalls] - public virtual Response GetMachineRunCommand(string runCommandName, CancellationToken cancellationToken = default) - { - return GetMachineRunCommands().Get(runCommandName, cancellationToken); - } - /// /// Retrieves information about the model view or the instance view of a hybrid machine. /// @@ -254,7 +192,7 @@ public virtual Response GetMachineRunCommand(string r /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -295,7 +233,7 @@ public virtual async Task> GetAsync(strin /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -336,7 +274,7 @@ public virtual Response Get(string expand = null, /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -380,7 +318,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -424,7 +362,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -466,7 +404,7 @@ public virtual async Task> UpdateAsync(Hy /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -508,7 +446,7 @@ public virtual Response Update(HybridComputeMachin /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -550,7 +488,7 @@ public virtual async Task> AssessPatche /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -592,7 +530,7 @@ public virtual ArmOperation AssessPatches(WaitUntil /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -638,7 +576,7 @@ public virtual async Task> InstallPatc /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -684,7 +622,7 @@ public virtual ArmOperation InstallPatches(WaitUnti /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// @@ -726,7 +664,7 @@ public virtual async Task UpgradeExtensionsAsync(WaitUntil waitUnt /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// @@ -768,7 +706,7 @@ public virtual ArmOperation UpgradeExtensions(WaitUntil waitUntil, MachineExtens /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// @@ -802,7 +740,7 @@ public virtual async Task> GetNetworkProfi /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// @@ -836,7 +774,7 @@ public virtual Response GetNetworkProfile(Cancellat /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -874,7 +812,7 @@ public virtual async Task> GetValida /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -912,7 +850,7 @@ public virtual Response GetValidationDetailsF /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -974,7 +912,7 @@ public virtual async Task> AddTagAsync(st /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -1036,7 +974,7 @@ public virtual Response AddTag(string key, string /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -1093,7 +1031,7 @@ public virtual async Task> SetTagsAsync(I /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -1150,7 +1088,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -1210,7 +1148,7 @@ public virtual async Task> RemoveTagAsync /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateEndpointConnectionCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateEndpointConnectionCollection.cs index 370f7dcad8318..13fce51dccf33 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateEndpointConnectionCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateEndpointConnectionCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation Crea /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(stri /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable Get /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(C /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string privateEndpointConn /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string privateEndpointConnectionName, Cance /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateEndpointConnectionResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateEndpointConnectionResource.cs index e59ef91495dc7..d5d7556110148 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateEndpointConnectionResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateEndpointConnectionResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(Canc /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkResource.cs index ec6968ee77a3a..f4cd857abc784 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(C /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkResourceCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkResourceCollection.cs index 5a99b77da1fb7..de2459b0c5466 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkResourceCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkResourceCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task> GetAsync(s /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get(string groupName, /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual AsyncPageable GetAllAsync(Cance /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -214,7 +214,7 @@ public virtual Pageable GetAll(CancellationTok /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -257,7 +257,7 @@ public virtual async Task> ExistsAsync(string groupName, Cancella /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -300,7 +300,7 @@ public virtual Response Exists(string groupName, CancellationToken cancell /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -345,7 +345,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkScopeCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkScopeCollection.cs index 52628ca177e93..f5732c02d91ee 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkScopeCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkScopeCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task> C /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrUpdat /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAs /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -257,7 +257,7 @@ public virtual Response Get(string scopeN /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -287,7 +287,7 @@ public virtual AsyncPageable GetAllAsync( /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -317,7 +317,7 @@ public virtual Pageable GetAll(Cancellati /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -360,7 +360,7 @@ public virtual async Task> ExistsAsync(string scopeName, Cancella /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -403,7 +403,7 @@ public virtual Response Exists(string scopeName, CancellationToken cancell /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -448,7 +448,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkScopeResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkScopeResource.cs index e6bfb3145c90e..b83789afd32ae 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkScopeResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkScopeResource.cs @@ -110,7 +110,7 @@ public virtual HybridComputePrivateLinkResourceCollection GetHybridComputePrivat /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetHybridC /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -179,7 +179,7 @@ public virtual HybridComputePrivateEndpointConnectionCollection GetHybridCompute /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -210,7 +210,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -248,7 +248,7 @@ public virtual NetworkSecurityPerimeterConfigurationCollection GetNetworkSecurit /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -279,7 +279,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -310,7 +310,7 @@ public virtual Response GetNetwor /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -350,7 +350,7 @@ public virtual async Task> GetAs /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -390,7 +390,7 @@ public virtual Response Get(CancellationT /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -432,7 +432,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -474,7 +474,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -516,7 +516,7 @@ public virtual async Task> Updat /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -558,7 +558,7 @@ public virtual Response Update(HybridComp /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -620,7 +620,7 @@ public virtual async Task> AddTa /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -682,7 +682,7 @@ public virtual Response AddTag(string key /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -739,7 +739,7 @@ public virtual async Task> SetTa /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -796,7 +796,7 @@ public virtual Response SetTags(IDictiona /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -856,7 +856,7 @@ public virtual async Task> Remov /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LicenseProfileData.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LicenseProfileData.Serialization.cs new file mode 100644 index 0000000000000..36cb1f2e824a7 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LicenseProfileData.Serialization.cs @@ -0,0 +1,896 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.HybridCompute.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.HybridCompute +{ + public partial class LicenseProfileData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LicenseProfileData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WritePropertyName("productProfile"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(SubscriptionStatus)) + { + writer.WritePropertyName("subscriptionStatus"u8); + writer.WriteStringValue(SubscriptionStatus.Value.ToString()); + } + if (Optional.IsDefined(ProductType)) + { + writer.WritePropertyName("productType"u8); + writer.WriteStringValue(ProductType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(EnrollmentOn)) + { + writer.WritePropertyName("enrollmentDate"u8); + writer.WriteStringValue(EnrollmentOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(BillingStartOn)) + { + writer.WritePropertyName("billingStartDate"u8); + writer.WriteStringValue(BillingStartOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(DisenrollmentOn)) + { + writer.WritePropertyName("disenrollmentDate"u8); + writer.WriteStringValue(DisenrollmentOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(BillingEndOn)) + { + writer.WritePropertyName("billingEndDate"u8); + writer.WriteStringValue(BillingEndOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + JsonSerializer.Serialize(writer, Error); + } + if (Optional.IsCollectionDefined(ProductFeatures)) + { + writer.WritePropertyName("productFeatures"u8); + writer.WriteStartArray(); + foreach (var item in ProductFeatures) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + writer.WritePropertyName("esuProfile"u8); + writer.WriteStartObject(); + if (options.Format != "W" && Optional.IsDefined(AssignedLicenseImmutableId)) + { + writer.WritePropertyName("assignedLicenseImmutableId"u8); + writer.WriteStringValue(AssignedLicenseImmutableId.Value); + } + if (options.Format != "W" && Optional.IsCollectionDefined(EsuKeys)) + { + writer.WritePropertyName("esuKeys"u8); + writer.WriteStartArray(); + foreach (var item in EsuKeys) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(ServerType)) + { + writer.WritePropertyName("serverType"u8); + writer.WriteStringValue(ServerType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(EsuEligibility)) + { + writer.WritePropertyName("esuEligibility"u8); + writer.WriteStringValue(EsuEligibility.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(EsuKeyState)) + { + writer.WritePropertyName("esuKeyState"u8); + writer.WriteStringValue(EsuKeyState.Value.ToString()); + } + if (Optional.IsDefined(AssignedLicense)) + { + writer.WritePropertyName("assignedLicense"u8); + writer.WriteStringValue(AssignedLicense); + } + writer.WriteEndObject(); + writer.WritePropertyName("softwareAssurance"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(SoftwareAssuranceCustomer)) + { + writer.WritePropertyName("softwareAssuranceCustomer"u8); + writer.WriteBooleanValue(SoftwareAssuranceCustomer.Value); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + LicenseProfileData 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(LicenseProfileData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLicenseProfileData(document.RootElement, options); + } + + internal static LicenseProfileData DeserializeLicenseProfileData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + HybridComputeProvisioningState? provisioningState = default; + LicenseProfileSubscriptionStatus? subscriptionStatus = default; + LicenseProfileProductType? productType = default; + DateTimeOffset? enrollmentDate = default; + DateTimeOffset? billingStartDate = default; + DateTimeOffset? disenrollmentDate = default; + DateTimeOffset? billingEndDate = default; + ResponseError error = default; + IList productFeatures = default; + Guid? assignedLicenseImmutableId = default; + IReadOnlyList esuKeys = default; + EsuServerType? serverType = default; + EsuEligibility? esuEligibility = default; + EsuKeyState? esuKeyState = default; + string assignedLicense = default; + bool? softwareAssuranceCustomer = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new HybridComputeProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("productProfile"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property1 in property0.Value.EnumerateObject()) + { + if (property1.NameEquals("subscriptionStatus"u8)) + { + if (property1.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + subscriptionStatus = new LicenseProfileSubscriptionStatus(property1.Value.GetString()); + continue; + } + if (property1.NameEquals("productType"u8)) + { + if (property1.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + productType = new LicenseProfileProductType(property1.Value.GetString()); + continue; + } + if (property1.NameEquals("enrollmentDate"u8)) + { + if (property1.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enrollmentDate = property1.Value.GetDateTimeOffset("O"); + continue; + } + if (property1.NameEquals("billingStartDate"u8)) + { + if (property1.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + billingStartDate = property1.Value.GetDateTimeOffset("O"); + continue; + } + if (property1.NameEquals("disenrollmentDate"u8)) + { + if (property1.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + disenrollmentDate = property1.Value.GetDateTimeOffset("O"); + continue; + } + if (property1.NameEquals("billingEndDate"u8)) + { + if (property1.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + billingEndDate = property1.Value.GetDateTimeOffset("O"); + continue; + } + if (property1.NameEquals("error"u8)) + { + if (property1.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = JsonSerializer.Deserialize(property1.Value.GetRawText()); + continue; + } + if (property1.NameEquals("productFeatures"u8)) + { + if (property1.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property1.Value.EnumerateArray()) + { + array.Add(HybridComputeProductFeature.DeserializeHybridComputeProductFeature(item, options)); + } + productFeatures = array; + continue; + } + } + continue; + } + if (property0.NameEquals("esuProfile"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property1 in property0.Value.EnumerateObject()) + { + if (property1.NameEquals("assignedLicenseImmutableId"u8)) + { + if (property1.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + assignedLicenseImmutableId = property1.Value.GetGuid(); + continue; + } + if (property1.NameEquals("esuKeys"u8)) + { + if (property1.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property1.Value.EnumerateArray()) + { + array.Add(EsuKey.DeserializeEsuKey(item, options)); + } + esuKeys = array; + continue; + } + if (property1.NameEquals("serverType"u8)) + { + if (property1.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serverType = new EsuServerType(property1.Value.GetString()); + continue; + } + if (property1.NameEquals("esuEligibility"u8)) + { + if (property1.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + esuEligibility = new EsuEligibility(property1.Value.GetString()); + continue; + } + if (property1.NameEquals("esuKeyState"u8)) + { + if (property1.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + esuKeyState = new EsuKeyState(property1.Value.GetString()); + continue; + } + if (property1.NameEquals("assignedLicense"u8)) + { + assignedLicense = property1.Value.GetString(); + continue; + } + } + continue; + } + if (property0.NameEquals("softwareAssurance"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property1 in property0.Value.EnumerateObject()) + { + if (property1.NameEquals("softwareAssuranceCustomer"u8)) + { + if (property1.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + softwareAssuranceCustomer = property1.Value.GetBoolean(); + continue; + } + } + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LicenseProfileData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + provisioningState, + subscriptionStatus, + productType, + enrollmentDate, + billingStartDate, + disenrollmentDate, + billingEndDate, + error, + productFeatures ?? new ChangeTrackingList(), + assignedLicenseImmutableId, + esuKeys ?? new ChangeTrackingList(), + serverType, + esuEligibility, + esuKeyState, + assignedLicense, + softwareAssuranceCustomer, + serializedAdditionalRawData); + } + + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" location: "); + builder.AppendLine(propertyOverride); + } + else + { + builder.Append(" location: "); + builder.AppendLine($"'{Location.ToString()}'"); + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" tags: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Tags)) + { + if (Tags.Any()) + { + builder.Append(" tags: "); + builder.AppendLine("{"); + foreach (var item in Tags) + { + builder.Append($" '{item.Key}': "); + if (item.Value == null) + { + builder.Append("null"); + continue; + } + if (item.Value.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{item.Value}'''"); + } + else + { + builder.AppendLine($"'{item.Value}'"); + } + } + builder.AppendLine(" }"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + builder.AppendLine($"'{ProvisioningState.Value.ToString()}'"); + } + } + + builder.Append(" productProfile:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SubscriptionStatus), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" subscriptionStatus: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SubscriptionStatus)) + { + builder.Append(" subscriptionStatus: "); + builder.AppendLine($"'{SubscriptionStatus.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProductType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" productType: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProductType)) + { + builder.Append(" productType: "); + builder.AppendLine($"'{ProductType.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnrollmentOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" enrollmentDate: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(EnrollmentOn)) + { + builder.Append(" enrollmentDate: "); + var formattedDateTimeString = TypeFormatters.ToString(EnrollmentOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(BillingStartOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" billingStartDate: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(BillingStartOn)) + { + builder.Append(" billingStartDate: "); + var formattedDateTimeString = TypeFormatters.ToString(BillingStartOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DisenrollmentOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" disenrollmentDate: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DisenrollmentOn)) + { + builder.Append(" disenrollmentDate: "); + var formattedDateTimeString = TypeFormatters.ToString(DisenrollmentOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(BillingEndOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" billingEndDate: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(BillingEndOn)) + { + builder.Append(" billingEndDate: "); + var formattedDateTimeString = TypeFormatters.ToString(BillingEndOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Error), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" error: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Error)) + { + builder.Append(" error: "); + BicepSerializationHelpers.AppendChildObject(builder, Error, options, 6, false, " error: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProductFeatures), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" productFeatures: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(ProductFeatures)) + { + if (ProductFeatures.Any()) + { + builder.Append(" productFeatures: "); + builder.AppendLine("["); + foreach (var item in ProductFeatures) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 8, true, " productFeatures: "); + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine(" }"); + builder.Append(" esuProfile:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AssignedLicenseImmutableId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" assignedLicenseImmutableId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AssignedLicenseImmutableId)) + { + builder.Append(" assignedLicenseImmutableId: "); + builder.AppendLine($"'{AssignedLicenseImmutableId.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EsuKeys), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" esuKeys: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(EsuKeys)) + { + if (EsuKeys.Any()) + { + builder.Append(" esuKeys: "); + builder.AppendLine("["); + foreach (var item in EsuKeys) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 8, true, " esuKeys: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ServerType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" serverType: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ServerType)) + { + builder.Append(" serverType: "); + builder.AppendLine($"'{ServerType.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EsuEligibility), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" esuEligibility: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(EsuEligibility)) + { + builder.Append(" esuEligibility: "); + builder.AppendLine($"'{EsuEligibility.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EsuKeyState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" esuKeyState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(EsuKeyState)) + { + builder.Append(" esuKeyState: "); + builder.AppendLine($"'{EsuKeyState.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AssignedLicense), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" assignedLicense: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AssignedLicense)) + { + builder.Append(" assignedLicense: "); + if (AssignedLicense.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{AssignedLicense}'''"); + } + else + { + builder.AppendLine($"'{AssignedLicense}'"); + } + } + } + + builder.AppendLine(" }"); + builder.Append(" softwareAssurance:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SoftwareAssuranceCustomer), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" softwareAssuranceCustomer: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SoftwareAssuranceCustomer)) + { + builder.Append(" softwareAssuranceCustomer: "); + var boolValue = SoftwareAssuranceCustomer.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + builder.AppendLine(" }"); + builder.AppendLine(" }"); + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); + default: + throw new FormatException($"The model {nameof(LicenseProfileData)} does not support writing '{options.Format}' format."); + } + } + + LicenseProfileData 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 DeserializeLicenseProfileData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LicenseProfileData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LicenseProfileData.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LicenseProfileData.cs new file mode 100644 index 0000000000000..42e13cbece5aa --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LicenseProfileData.cs @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.HybridCompute.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.HybridCompute +{ + /// + /// A class representing the LicenseProfile data model. + /// Describes a license profile in a hybrid machine. + /// + public partial class LicenseProfileData : TrackedResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The location. + public LicenseProfileData(AzureLocation location) : base(location) + { + ProductFeatures = new ChangeTrackingList(); + EsuKeys = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The provisioning state, which only appears in the response. + /// Indicates the subscription status of the product. + /// Indicates the product type of the license. + /// The timestamp in UTC when the user enrolls the feature. + /// The timestamp in UTC when the billing starts. + /// The timestamp in UTC when the user disenrolled the feature. + /// The timestamp in UTC when the billing ends. + /// The errors that were encountered during the feature enrollment or disenrollment. + /// The list of product features. + /// The guid id of the license. + /// The list of ESU keys. + /// The type of the Esu servers. + /// Indicates the eligibility state of Esu. + /// Indicates whether there is an ESU Key currently active for the machine. + /// The resource id of the license. + /// Specifies if this machine is licensed as part of a Software Assurance agreement. + /// Keeps track of any properties unknown to the library. + internal LicenseProfileData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, HybridComputeProvisioningState? provisioningState, LicenseProfileSubscriptionStatus? subscriptionStatus, LicenseProfileProductType? productType, DateTimeOffset? enrollmentOn, DateTimeOffset? billingStartOn, DateTimeOffset? disenrollmentOn, DateTimeOffset? billingEndOn, ResponseError error, IList productFeatures, Guid? assignedLicenseImmutableId, IReadOnlyList esuKeys, EsuServerType? serverType, EsuEligibility? esuEligibility, EsuKeyState? esuKeyState, string assignedLicense, bool? softwareAssuranceCustomer, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + ProvisioningState = provisioningState; + SubscriptionStatus = subscriptionStatus; + ProductType = productType; + EnrollmentOn = enrollmentOn; + BillingStartOn = billingStartOn; + DisenrollmentOn = disenrollmentOn; + BillingEndOn = billingEndOn; + Error = error; + ProductFeatures = productFeatures; + AssignedLicenseImmutableId = assignedLicenseImmutableId; + EsuKeys = esuKeys; + ServerType = serverType; + EsuEligibility = esuEligibility; + EsuKeyState = esuKeyState; + AssignedLicense = assignedLicense; + SoftwareAssuranceCustomer = softwareAssuranceCustomer; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal LicenseProfileData() + { + } + + /// The provisioning state, which only appears in the response. + [WirePath("properties.provisioningState")] + public HybridComputeProvisioningState? ProvisioningState { get; } + /// Indicates the subscription status of the product. + [WirePath("properties.subscriptionStatus")] + public LicenseProfileSubscriptionStatus? SubscriptionStatus { get; set; } + /// Indicates the product type of the license. + [WirePath("properties.productType")] + public LicenseProfileProductType? ProductType { get; set; } + /// The timestamp in UTC when the user enrolls the feature. + [WirePath("properties.enrollmentDate")] + public DateTimeOffset? EnrollmentOn { get; } + /// The timestamp in UTC when the billing starts. + [WirePath("properties.billingStartDate")] + public DateTimeOffset? BillingStartOn { get; } + /// The timestamp in UTC when the user disenrolled the feature. + [WirePath("properties.disenrollmentDate")] + public DateTimeOffset? DisenrollmentOn { get; } + /// The timestamp in UTC when the billing ends. + [WirePath("properties.billingEndDate")] + public DateTimeOffset? BillingEndOn { get; } + /// The errors that were encountered during the feature enrollment or disenrollment. + [WirePath("properties.error")] + public ResponseError Error { get; } + /// The list of product features. + [WirePath("properties.productFeatures")] + public IList ProductFeatures { get; } + /// The guid id of the license. + [WirePath("properties.assignedLicenseImmutableId")] + public Guid? AssignedLicenseImmutableId { get; } + /// The list of ESU keys. + [WirePath("properties.esuKeys")] + public IReadOnlyList EsuKeys { get; } + /// The type of the Esu servers. + [WirePath("properties.serverType")] + public EsuServerType? ServerType { get; } + /// Indicates the eligibility state of Esu. + [WirePath("properties.esuEligibility")] + public EsuEligibility? EsuEligibility { get; } + /// Indicates whether there is an ESU Key currently active for the machine. + [WirePath("properties.esuKeyState")] + public EsuKeyState? EsuKeyState { get; } + /// The resource id of the license. + [WirePath("properties.assignedLicense")] + public string AssignedLicense { get; set; } + /// Specifies if this machine is licensed as part of a Software Assurance agreement. + [WirePath("properties.softwareAssuranceCustomer")] + public bool? SoftwareAssuranceCustomer { get; set; } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LicenseProfileResource.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LicenseProfileResource.Serialization.cs new file mode 100644 index 0000000000000..bc3be367d78a2 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LicenseProfileResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.HybridCompute +{ + public partial class LicenseProfileResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + LicenseProfileData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + LicenseProfileData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LicenseProfileResource.cs similarity index 54% rename from sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandResource.cs rename to sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LicenseProfileResource.cs index a2e72e8173a34..662d8a247b8af 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LicenseProfileResource.cs @@ -12,57 +12,57 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager.HybridCompute.Models; namespace Azure.ResourceManager.HybridCompute { /// - /// A Class representing a MachineRunCommand along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetMachineRunCommandResource method. - /// Otherwise you can get one from its parent resource using the GetMachineRunCommand method. + /// A Class representing a LicenseProfile along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetLicenseProfileResource method. + /// Otherwise you can get one from its parent resource using the GetLicenseProfile method. /// - public partial class MachineRunCommandResource : ArmResource + public partial class LicenseProfileResource : ArmResource { - /// Generate the resource identifier of a instance. + /// Generate the resource identifier of a instance. /// The subscriptionId. /// The resourceGroupName. /// The machineName. - /// The runCommandName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string machineName, string runCommandName) + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string machineName) { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}"; + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles/default"; return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _machineRunCommandClientDiagnostics; - private readonly MachineRunCommandsRestOperations _machineRunCommandRestClient; - private readonly MachineRunCommandData _data; + private readonly ClientDiagnostics _licenseProfileClientDiagnostics; + private readonly LicenseProfilesRestOperations _licenseProfileRestClient; + private readonly LicenseProfileData _data; /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.HybridCompute/machines/runCommands"; + public static readonly ResourceType ResourceType = "Microsoft.HybridCompute/machines/licenseProfiles"; - /// Initializes a new instance of the class for mocking. - protected MachineRunCommandResource() + /// Initializes a new instance of the class for mocking. + protected LicenseProfileResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The resource that is the target of operations. - internal MachineRunCommandResource(ArmClient client, MachineRunCommandData data) : this(client, data.Id) + internal LicenseProfileResource(ArmClient client, LicenseProfileData data) : this(client, data.Id) { HasData = true; _data = data; } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. - internal MachineRunCommandResource(ArmClient client, ResourceIdentifier id) : base(client, id) + internal LicenseProfileResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _machineRunCommandClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridCompute", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string machineRunCommandApiVersion); - _machineRunCommandRestClient = new MachineRunCommandsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, machineRunCommandApiVersion); + _licenseProfileClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridCompute", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string licenseProfileApiVersion); + _licenseProfileRestClient = new LicenseProfilesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, licenseProfileApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -73,7 +73,7 @@ internal MachineRunCommandResource(ArmClient client, ResourceIdentifier id) : ba /// Gets the data representing this Feature. /// Throws if there is no data loaded in the current instance. - public virtual MachineRunCommandData Data + public virtual LicenseProfileData Data { get { @@ -90,37 +90,37 @@ internal static void ValidateResourceId(ResourceIdentifier id) } /// - /// The operation to get a run command. + /// Retrieves information about the view of a license profile. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName} /// /// /// Operation Id - /// MachineRunCommands_Get + /// LicenseProfiles_Get /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandResource.Get"); + using var scope = _licenseProfileClientDiagnostics.CreateScope("LicenseProfileResource.Get"); scope.Start(); try { - var response = await _machineRunCommandRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _licenseProfileRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new MachineRunCommandResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new LicenseProfileResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -130,37 +130,37 @@ public virtual async Task> GetAsync(Cancella } /// - /// The operation to get a run command. + /// Retrieves information about the view of a license profile. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName} /// /// /// Operation Id - /// MachineRunCommands_Get + /// LicenseProfiles_Get /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) + public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandResource.Get"); + using var scope = _licenseProfileClientDiagnostics.CreateScope("LicenseProfileResource.Get"); scope.Start(); try { - var response = _machineRunCommandRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _licenseProfileRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new MachineRunCommandResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new LicenseProfileResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -170,23 +170,23 @@ public virtual Response Get(CancellationToken cancell } /// - /// The operation to delete a run command. + /// The operation to delete a license profile. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName} /// /// /// Operation Id - /// MachineRunCommands_Delete + /// LicenseProfiles_Delete /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource - /// + /// /// /// /// @@ -194,12 +194,12 @@ public virtual Response Get(CancellationToken cancell /// The cancellation token to use. public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandResource.Delete"); + using var scope = _licenseProfileClientDiagnostics.CreateScope("LicenseProfileResource.Delete"); scope.Start(); try { - var response = await _machineRunCommandRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new HybridComputeArmOperation(_machineRunCommandClientDiagnostics, Pipeline, _machineRunCommandRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _licenseProfileRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken).ConfigureAwait(false); + var operation = new HybridComputeArmOperation(_licenseProfileClientDiagnostics, Pipeline, _licenseProfileRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -212,23 +212,23 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell } /// - /// The operation to delete a run command. + /// The operation to delete a license profile. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName} /// /// /// Operation Id - /// MachineRunCommands_Delete + /// LicenseProfiles_Delete /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource - /// + /// /// /// /// @@ -236,12 +236,12 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// The cancellation token to use. public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandResource.Delete"); + using var scope = _licenseProfileClientDiagnostics.CreateScope("LicenseProfileResource.Delete"); scope.Start(); try { - var response = _machineRunCommandRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new HybridComputeArmOperation(_machineRunCommandClientDiagnostics, Pipeline, _machineRunCommandRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _licenseProfileRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken); + var operation = new HybridComputeArmOperation(_licenseProfileClientDiagnostics, Pipeline, _licenseProfileRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -254,40 +254,132 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel } /// - /// The operation to create or update a run command. + /// The operation to update a license profile. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName} /// /// /// Operation Id - /// MachineRunCommands_CreateOrUpdate + /// LicenseProfiles_Update /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource - /// + /// /// /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Parameters supplied to the Create Run Command. + /// Parameters supplied to the Update license profile operation. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, LicenseProfilePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _licenseProfileClientDiagnostics.CreateScope("LicenseProfileResource.Update"); + scope.Start(); + try + { + var response = await _licenseProfileRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new HybridComputeArmOperation(new LicenseProfileOperationSource(Client), _licenseProfileClientDiagnostics, Pipeline, _licenseProfileRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// The operation to update a license profile. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName} + /// + /// + /// Operation Id + /// LicenseProfiles_Update + /// + /// + /// Default Api Version + /// 2024-07-10 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Parameters supplied to the Update license profile operation. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, LicenseProfilePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _licenseProfileClientDiagnostics.CreateScope("LicenseProfileResource.Update"); + scope.Start(); + try + { + var response = _licenseProfileRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, patch, cancellationToken); + var operation = new HybridComputeArmOperation(new LicenseProfileOperationSource(Client), _licenseProfileClientDiagnostics, Pipeline, _licenseProfileRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// The operation to create or update a license profile. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName} + /// + /// + /// Operation Id + /// LicenseProfiles_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2024-07-10 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Parameters supplied to the Create or Update license profile operation. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, MachineRunCommandData data, CancellationToken cancellationToken = default) + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, LicenseProfileData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandResource.Update"); + using var scope = _licenseProfileClientDiagnostics.CreateScope("LicenseProfileResource.CreateOrUpdate"); scope.Start(); try { - var response = await _machineRunCommandRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new HybridComputeArmOperation(new MachineRunCommandOperationSource(Client), _machineRunCommandClientDiagnostics, Pipeline, _machineRunCommandRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = await _licenseProfileRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new HybridComputeArmOperation(new LicenseProfileOperationSource(Client), _licenseProfileClientDiagnostics, Pipeline, _licenseProfileRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -300,40 +392,40 @@ public virtual async Task> UpdateAsync(W } /// - /// The operation to create or update a run command. + /// The operation to create or update a license profile. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName} /// /// /// Operation Id - /// MachineRunCommands_CreateOrUpdate + /// LicenseProfiles_CreateOrUpdate /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource - /// + /// /// /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// Parameters supplied to the Create Run Command. + /// Parameters supplied to the Create or Update license profile operation. /// The cancellation token to use. /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, MachineRunCommandData data, CancellationToken cancellationToken = default) + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, LicenseProfileData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandResource.Update"); + using var scope = _licenseProfileClientDiagnostics.CreateScope("LicenseProfileResource.CreateOrUpdate"); scope.Start(); try { - var response = _machineRunCommandRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); - var operation = new HybridComputeArmOperation(new MachineRunCommandOperationSource(Client), _machineRunCommandClientDiagnostics, Pipeline, _machineRunCommandRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + var response = _licenseProfileRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, data, cancellationToken); + var operation = new HybridComputeArmOperation(new LicenseProfileOperationSource(Client), _licenseProfileClientDiagnostics, Pipeline, _licenseProfileRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -350,19 +442,19 @@ public virtual ArmOperation Update(WaitUntil waitUnti /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName} /// /// /// Operation Id - /// MachineRunCommands_Get + /// LicenseProfiles_Get /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource - /// + /// /// /// /// @@ -370,12 +462,12 @@ public virtual ArmOperation Update(WaitUntil waitUnti /// The value for the tag. /// The cancellation token to use. /// or is null. - public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandResource.AddTag"); + using var scope = _licenseProfileClientDiagnostics.CreateScope("LicenseProfileResource.AddTag"); scope.Start(); try { @@ -384,14 +476,19 @@ public virtual async Task> AddTagAsync(strin var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues[key] = value; await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _machineRunCommandRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new MachineRunCommandResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _licenseProfileRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new LicenseProfileResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - current.Tags[key] = value; - var result = await UpdateAsync(WaitUntil.Completed, current, cancellationToken: cancellationToken).ConfigureAwait(false); + var patch = new LicenseProfilePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(result.Value, result.GetRawResponse()); } } @@ -407,19 +504,19 @@ public virtual async Task> AddTagAsync(strin /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName} /// /// /// Operation Id - /// MachineRunCommands_Get + /// LicenseProfiles_Get /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource - /// + /// /// /// /// @@ -427,12 +524,12 @@ public virtual async Task> AddTagAsync(strin /// The value for the tag. /// The cancellation token to use. /// or is null. - public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandResource.AddTag"); + using var scope = _licenseProfileClientDiagnostics.CreateScope("LicenseProfileResource.AddTag"); scope.Start(); try { @@ -441,14 +538,19 @@ public virtual Response AddTag(string key, string val var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues[key] = value; GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _machineRunCommandRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new MachineRunCommandResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = _licenseProfileRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken); + return Response.FromValue(new LicenseProfileResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = Get(cancellationToken: cancellationToken).Value.Data; - current.Tags[key] = value; - var result = Update(WaitUntil.Completed, current, cancellationToken: cancellationToken); + var patch = new LicenseProfilePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); return Response.FromValue(result.Value, result.GetRawResponse()); } } @@ -464,30 +566,30 @@ public virtual Response AddTag(string key, string val /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName} /// /// /// Operation Id - /// MachineRunCommands_Get + /// LicenseProfiles_Get /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource - /// + /// /// /// /// /// The set of tags to use as replacement. /// The cancellation token to use. /// is null. - public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandResource.SetTags"); + using var scope = _licenseProfileClientDiagnostics.CreateScope("LicenseProfileResource.SetTags"); scope.Start(); try { @@ -497,14 +599,15 @@ public virtual async Task> SetTagsAsync(IDic var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.ReplaceWith(tags); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _machineRunCommandRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new MachineRunCommandResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _licenseProfileRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new LicenseProfileResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - current.Tags.ReplaceWith(tags); - var result = await UpdateAsync(WaitUntil.Completed, current, cancellationToken: cancellationToken).ConfigureAwait(false); + var patch = new LicenseProfilePatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(result.Value, result.GetRawResponse()); } } @@ -520,30 +623,30 @@ public virtual async Task> SetTagsAsync(IDic /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName} /// /// /// Operation Id - /// MachineRunCommands_Get + /// LicenseProfiles_Get /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource - /// + /// /// /// /// /// The set of tags to use as replacement. /// The cancellation token to use. /// is null. - public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandResource.SetTags"); + using var scope = _licenseProfileClientDiagnostics.CreateScope("LicenseProfileResource.SetTags"); scope.Start(); try { @@ -553,14 +656,15 @@ public virtual Response SetTags(IDictionary SetTags(IDictionary /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName} /// /// /// Operation Id - /// MachineRunCommands_Get + /// LicenseProfiles_Get /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource - /// + /// /// /// /// /// The key for the tag. /// The cancellation token to use. /// is null. - public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); - using var scope = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandResource.RemoveTag"); + using var scope = _licenseProfileClientDiagnostics.CreateScope("LicenseProfileResource.RemoveTag"); scope.Start(); try { @@ -608,14 +712,19 @@ public virtual async Task> RemoveTagAsync(st var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.Remove(key); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _machineRunCommandRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new MachineRunCommandResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _licenseProfileRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new LicenseProfileResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - current.Tags.Remove(key); - var result = await UpdateAsync(WaitUntil.Completed, current, cancellationToken: cancellationToken).ConfigureAwait(false); + var patch = new LicenseProfilePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(result.Value, result.GetRawResponse()); } } @@ -631,30 +740,30 @@ public virtual async Task> RemoveTagAsync(st /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/licenseProfiles/{licenseProfileName} /// /// /// Operation Id - /// MachineRunCommands_Get + /// LicenseProfiles_Get /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource - /// + /// /// /// /// /// The key for the tag. /// The cancellation token to use. /// is null. - public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); - using var scope = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandResource.RemoveTag"); + using var scope = _licenseProfileClientDiagnostics.CreateScope("LicenseProfileResource.RemoveTag"); scope.Start(); try { @@ -663,14 +772,19 @@ public virtual Response RemoveTag(string key, Cancell var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.Remove(key); GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _machineRunCommandRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - return Response.FromValue(new MachineRunCommandResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = _licenseProfileRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken); + return Response.FromValue(new LicenseProfileResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = Get(cancellationToken: cancellationToken).Value.Data; - current.Tags.Remove(key); - var result = Update(WaitUntil.Completed, current, cancellationToken: cancellationToken); + var patch = new LicenseProfilePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); return Response.FromValue(result.Value, result.GetRawResponse()); } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/HybridComputeGatewayOperationSource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/HybridComputeGatewayOperationSource.cs deleted file mode 100644 index a8caa3bd0e2c9..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/HybridComputeGatewayOperationSource.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.HybridCompute -{ - internal class HybridComputeGatewayOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal HybridComputeGatewayOperationSource(ArmClient client) - { - _client = client; - } - - HybridComputeGatewayResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = HybridComputeGatewayData.DeserializeHybridComputeGatewayData(document.RootElement); - return new HybridComputeGatewayResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = HybridComputeGatewayData.DeserializeHybridComputeGatewayData(document.RootElement); - return new HybridComputeGatewayResource(_client, data); - } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/LicenseProfileOperationSource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/LicenseProfileOperationSource.cs new file mode 100644 index 0000000000000..d3a4e82e65a00 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/LicenseProfileOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.HybridCompute +{ + internal class LicenseProfileOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal LicenseProfileOperationSource(ArmClient client) + { + _client = client; + } + + LicenseProfileResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = LicenseProfileData.DeserializeLicenseProfileData(document.RootElement); + return new LicenseProfileResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = LicenseProfileData.DeserializeLicenseProfileData(document.RootElement); + return new LicenseProfileResource(_client, data); + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/MachineRunCommandOperationSource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/MachineRunCommandOperationSource.cs deleted file mode 100644 index 82b1b4e7c8b2b..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/MachineRunCommandOperationSource.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.HybridCompute -{ - internal class MachineRunCommandOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal MachineRunCommandOperationSource(ArmClient client) - { - _client = client; - } - - MachineRunCommandResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = MachineRunCommandData.DeserializeMachineRunCommandData(document.RootElement); - return new MachineRunCommandResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = MachineRunCommandData.DeserializeMachineRunCommandData(document.RootElement); - return new MachineRunCommandResource(_client, data); - } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/NetworkSecurityPerimeterConfigurationReconcileResultOperationSource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/NetworkSecurityPerimeterConfigurationReconcileResultOperationSource.cs new file mode 100644 index 0000000000000..e2a8e3da43481 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/NetworkSecurityPerimeterConfigurationReconcileResultOperationSource.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.HybridCompute.Models; + +namespace Azure.ResourceManager.HybridCompute +{ + internal class NetworkSecurityPerimeterConfigurationReconcileResultOperationSource : IOperationSource + { + NetworkSecurityPerimeterConfigurationReconcileResult IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + return NetworkSecurityPerimeterConfigurationReconcileResult.DeserializeNetworkSecurityPerimeterConfigurationReconcileResult(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + return NetworkSecurityPerimeterConfigurationReconcileResult.DeserializeNetworkSecurityPerimeterConfigurationReconcileResult(document.RootElement); + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandCollection.cs deleted file mode 100644 index ab8dee3bd73b1..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandCollection.cs +++ /dev/null @@ -1,495 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Threading; -using System.Threading.Tasks; -using Autorest.CSharp.Core; -using Azure.Core; -using Azure.Core.Pipeline; - -namespace Azure.ResourceManager.HybridCompute -{ - /// - /// A class representing a collection of and their operations. - /// Each in the collection will belong to the same instance of . - /// To get a instance call the GetMachineRunCommands method from an instance of . - /// - public partial class MachineRunCommandCollection : ArmCollection, IEnumerable, IAsyncEnumerable - { - private readonly ClientDiagnostics _machineRunCommandClientDiagnostics; - private readonly MachineRunCommandsRestOperations _machineRunCommandRestClient; - - /// Initializes a new instance of the class for mocking. - protected MachineRunCommandCollection() - { - } - - /// Initializes a new instance of the class. - /// The client parameters to use in these operations. - /// The identifier of the parent resource that is the target of operations. - internal MachineRunCommandCollection(ArmClient client, ResourceIdentifier id) : base(client, id) - { - _machineRunCommandClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridCompute", MachineRunCommandResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(MachineRunCommandResource.ResourceType, out string machineRunCommandApiVersion); - _machineRunCommandRestClient = new MachineRunCommandsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, machineRunCommandApiVersion); -#if DEBUG - ValidateResourceId(Id); -#endif - } - - internal static void ValidateResourceId(ResourceIdentifier id) - { - if (id.ResourceType != HybridComputeMachineResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, HybridComputeMachineResource.ResourceType), nameof(id)); - } - - /// - /// The operation to create or update a run command. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} - /// - /// - /// Operation Id - /// MachineRunCommands_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the run command. - /// Parameters supplied to the Create Run Command. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string runCommandName, MachineRunCommandData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(runCommandName, nameof(runCommandName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = await _machineRunCommandRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, runCommandName, data, cancellationToken).ConfigureAwait(false); - var operation = new HybridComputeArmOperation(new MachineRunCommandOperationSource(Client), _machineRunCommandClientDiagnostics, Pipeline, _machineRunCommandRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, runCommandName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// The operation to create or update a run command. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} - /// - /// - /// Operation Id - /// MachineRunCommands_CreateOrUpdate - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The name of the run command. - /// Parameters supplied to the Create Run Command. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string runCommandName, MachineRunCommandData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(runCommandName, nameof(runCommandName)); - Argument.AssertNotNull(data, nameof(data)); - - using var scope = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandCollection.CreateOrUpdate"); - scope.Start(); - try - { - var response = _machineRunCommandRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, runCommandName, data, cancellationToken); - var operation = new HybridComputeArmOperation(new MachineRunCommandOperationSource(Client), _machineRunCommandClientDiagnostics, Pipeline, _machineRunCommandRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, runCommandName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); - if (waitUntil == WaitUntil.Completed) - operation.WaitForCompletion(cancellationToken); - return operation; - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// The operation to get a run command. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} - /// - /// - /// Operation Id - /// MachineRunCommands_Get - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the run command. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetAsync(string runCommandName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(runCommandName, nameof(runCommandName)); - - using var scope = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandCollection.Get"); - scope.Start(); - try - { - var response = await _machineRunCommandRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, runCommandName, cancellationToken).ConfigureAwait(false); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new MachineRunCommandResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// The operation to get a run command. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} - /// - /// - /// Operation Id - /// MachineRunCommands_Get - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the run command. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Get(string runCommandName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(runCommandName, nameof(runCommandName)); - - using var scope = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandCollection.Get"); - scope.Start(); - try - { - var response = _machineRunCommandRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, runCommandName, cancellationToken); - if (response.Value == null) - throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new MachineRunCommandResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// The operation to get all the run commands of a non-Azure machine. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands - /// - /// - /// Operation Id - /// MachineRunCommands_List - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The expand expression to apply on the operation. - /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(string expand = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineRunCommandRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, expand); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineRunCommandRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, expand); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MachineRunCommandResource(Client, MachineRunCommandData.DeserializeMachineRunCommandData(e)), _machineRunCommandClientDiagnostics, Pipeline, "MachineRunCommandCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// The operation to get all the run commands of a non-Azure machine. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands - /// - /// - /// Operation Id - /// MachineRunCommands_List - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The expand expression to apply on the operation. - /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(string expand = null, CancellationToken cancellationToken = default) - { - HttpMessage FirstPageRequest(int? pageSizeHint) => _machineRunCommandRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, expand); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _machineRunCommandRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, expand); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MachineRunCommandResource(Client, MachineRunCommandData.DeserializeMachineRunCommandData(e)), _machineRunCommandClientDiagnostics, Pipeline, "MachineRunCommandCollection.GetAll", "value", "nextLink", cancellationToken); - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} - /// - /// - /// Operation Id - /// MachineRunCommands_Get - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the run command. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> ExistsAsync(string runCommandName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(runCommandName, nameof(runCommandName)); - - using var scope = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandCollection.Exists"); - scope.Start(); - try - { - var response = await _machineRunCommandRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, runCommandName, cancellationToken: cancellationToken).ConfigureAwait(false); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Checks to see if the resource exists in azure. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} - /// - /// - /// Operation Id - /// MachineRunCommands_Get - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the run command. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response Exists(string runCommandName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(runCommandName, nameof(runCommandName)); - - using var scope = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandCollection.Exists"); - scope.Start(); - try - { - var response = _machineRunCommandRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, runCommandName, cancellationToken: cancellationToken); - return Response.FromValue(response.Value != null, response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} - /// - /// - /// Operation Id - /// MachineRunCommands_Get - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the run command. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetIfExistsAsync(string runCommandName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(runCommandName, nameof(runCommandName)); - - using var scope = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandCollection.GetIfExists"); - scope.Start(); - try - { - var response = await _machineRunCommandRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, runCommandName, cancellationToken: cancellationToken).ConfigureAwait(false); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new MachineRunCommandResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - /// - /// Tries to get details for this resource from the service. - /// - /// - /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName} - /// - /// - /// Operation Id - /// MachineRunCommands_Get - /// - /// - /// Default Api Version - /// 2024-05-20-preview - /// - /// - /// Resource - /// - /// - /// - /// - /// The name of the run command. - /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual NullableResponse GetIfExists(string runCommandName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(runCommandName, nameof(runCommandName)); - - using var scope = _machineRunCommandClientDiagnostics.CreateScope("MachineRunCommandCollection.GetIfExists"); - scope.Start(); - try - { - var response = _machineRunCommandRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, runCommandName, cancellationToken: cancellationToken); - if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new MachineRunCommandResource(Client, response.Value), response.GetRawResponse()); - } - catch (Exception e) - { - scope.Failed(e); - throw; - } - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return GetAll().GetEnumerator(); - } - - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) - { - return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); - } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandData.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandData.Serialization.cs deleted file mode 100644 index cae0ef0e767ec..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandData.Serialization.cs +++ /dev/null @@ -1,753 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.HybridCompute.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.HybridCompute -{ - public partial class MachineRunCommandData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(MachineRunCommandData)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(Source)) - { - writer.WritePropertyName("source"u8); - writer.WriteObjectValue(Source, options); - } - if (Optional.IsCollectionDefined(Parameters)) - { - writer.WritePropertyName("parameters"u8); - writer.WriteStartArray(); - foreach (var item in Parameters) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsCollectionDefined(ProtectedParameters)) - { - writer.WritePropertyName("protectedParameters"u8); - writer.WriteStartArray(); - foreach (var item in ProtectedParameters) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(AsyncExecution)) - { - writer.WritePropertyName("asyncExecution"u8); - writer.WriteBooleanValue(AsyncExecution.Value); - } - if (Optional.IsDefined(RunAsUser)) - { - writer.WritePropertyName("runAsUser"u8); - writer.WriteStringValue(RunAsUser); - } - if (Optional.IsDefined(RunAsPassword)) - { - writer.WritePropertyName("runAsPassword"u8); - writer.WriteStringValue(RunAsPassword); - } - if (Optional.IsDefined(TimeoutInSeconds)) - { - writer.WritePropertyName("timeoutInSeconds"u8); - writer.WriteNumberValue(TimeoutInSeconds.Value); - } - if (Optional.IsDefined(OutputBlobUri)) - { - writer.WritePropertyName("outputBlobUri"u8); - writer.WriteStringValue(OutputBlobUri.AbsoluteUri); - } - if (Optional.IsDefined(ErrorBlobUri)) - { - writer.WritePropertyName("errorBlobUri"u8); - writer.WriteStringValue(ErrorBlobUri.AbsoluteUri); - } - if (Optional.IsDefined(OutputBlobManagedIdentity)) - { - writer.WritePropertyName("outputBlobManagedIdentity"u8); - writer.WriteObjectValue(OutputBlobManagedIdentity, options); - } - if (Optional.IsDefined(ErrorBlobManagedIdentity)) - { - writer.WritePropertyName("errorBlobManagedIdentity"u8); - writer.WriteObjectValue(ErrorBlobManagedIdentity, options); - } - if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) - { - writer.WritePropertyName("provisioningState"u8); - writer.WriteStringValue(ProvisioningState); - } - if (options.Format != "W" && Optional.IsDefined(InstanceView)) - { - writer.WritePropertyName("instanceView"u8); - writer.WriteObjectValue(InstanceView, options); - } - writer.WriteEndObject(); - } - - MachineRunCommandData 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(MachineRunCommandData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMachineRunCommandData(document.RootElement, options); - } - - internal static MachineRunCommandData DeserializeMachineRunCommandData(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IDictionary tags = default; - AzureLocation location = default; - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - MachineRunCommandScriptSource source = default; - IList parameters = default; - IList protectedParameters = default; - bool? asyncExecution = default; - string runAsUser = default; - string runAsPassword = default; - int? timeoutInSeconds = default; - Uri outputBlobUri = default; - Uri errorBlobUri = default; - RunCommandManagedIdentity outputBlobManagedIdentity = default; - RunCommandManagedIdentity errorBlobManagedIdentity = default; - string provisioningState = default; - MachineRunCommandInstanceView instanceView = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("location"u8)) - { - location = new AzureLocation(property.Value.GetString()); - continue; - } - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("source"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - source = MachineRunCommandScriptSource.DeserializeMachineRunCommandScriptSource(property0.Value, options); - continue; - } - if (property0.NameEquals("parameters"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(RunCommandInputParameter.DeserializeRunCommandInputParameter(item, options)); - } - parameters = array; - continue; - } - if (property0.NameEquals("protectedParameters"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(RunCommandInputParameter.DeserializeRunCommandInputParameter(item, options)); - } - protectedParameters = array; - continue; - } - if (property0.NameEquals("asyncExecution"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - asyncExecution = property0.Value.GetBoolean(); - continue; - } - if (property0.NameEquals("runAsUser"u8)) - { - runAsUser = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("runAsPassword"u8)) - { - runAsPassword = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("timeoutInSeconds"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - timeoutInSeconds = property0.Value.GetInt32(); - continue; - } - if (property0.NameEquals("outputBlobUri"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - outputBlobUri = new Uri(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("errorBlobUri"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - errorBlobUri = new Uri(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("outputBlobManagedIdentity"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - outputBlobManagedIdentity = RunCommandManagedIdentity.DeserializeRunCommandManagedIdentity(property0.Value, options); - continue; - } - if (property0.NameEquals("errorBlobManagedIdentity"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - errorBlobManagedIdentity = RunCommandManagedIdentity.DeserializeRunCommandManagedIdentity(property0.Value, options); - continue; - } - if (property0.NameEquals("provisioningState"u8)) - { - provisioningState = property0.Value.GetString(); - continue; - } - if (property0.NameEquals("instanceView"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - instanceView = MachineRunCommandInstanceView.DeserializeMachineRunCommandInstanceView(property0.Value, options); - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MachineRunCommandData( - id, - name, - type, - systemData, - tags ?? new ChangeTrackingDictionary(), - location, - source, - parameters ?? new ChangeTrackingList(), - protectedParameters ?? new ChangeTrackingList(), - asyncExecution, - runAsUser, - runAsPassword, - timeoutInSeconds, - outputBlobUri, - errorBlobUri, - outputBlobManagedIdentity, - errorBlobManagedIdentity, - provisioningState, - instanceView, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" location: "); - builder.AppendLine(propertyOverride); - } - else - { - builder.Append(" location: "); - builder.AppendLine($"'{Location.ToString()}'"); - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tags), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" tags: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Tags)) - { - if (Tags.Any()) - { - builder.Append(" tags: "); - builder.AppendLine("{"); - foreach (var item in Tags) - { - builder.Append($" '{item.Key}': "); - if (item.Value == null) - { - builder.Append("null"); - continue; - } - if (item.Value.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{item.Value}'''"); - } - else - { - builder.AppendLine($"'{item.Value}'"); - } - } - builder.AppendLine(" }"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Source), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" source: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Source)) - { - builder.Append(" source: "); - BicepSerializationHelpers.AppendChildObject(builder, Source, options, 4, false, " source: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Parameters), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" parameters: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Parameters)) - { - if (Parameters.Any()) - { - builder.Append(" parameters: "); - builder.AppendLine("["); - foreach (var item in Parameters) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 6, true, " parameters: "); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProtectedParameters), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" protectedParameters: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(ProtectedParameters)) - { - if (ProtectedParameters.Any()) - { - builder.Append(" protectedParameters: "); - builder.AppendLine("["); - foreach (var item in ProtectedParameters) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 6, true, " protectedParameters: "); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AsyncExecution), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" asyncExecution: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(AsyncExecution)) - { - builder.Append(" asyncExecution: "); - var boolValue = AsyncExecution.Value == true ? "true" : "false"; - builder.AppendLine($"{boolValue}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RunAsUser), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" runAsUser: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(RunAsUser)) - { - builder.Append(" runAsUser: "); - if (RunAsUser.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{RunAsUser}'''"); - } - else - { - builder.AppendLine($"'{RunAsUser}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RunAsPassword), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" runAsPassword: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(RunAsPassword)) - { - builder.Append(" runAsPassword: "); - if (RunAsPassword.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{RunAsPassword}'''"); - } - else - { - builder.AppendLine($"'{RunAsPassword}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TimeoutInSeconds), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" timeoutInSeconds: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(TimeoutInSeconds)) - { - builder.Append(" timeoutInSeconds: "); - builder.AppendLine($"{TimeoutInSeconds.Value}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OutputBlobUri), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" outputBlobUri: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(OutputBlobUri)) - { - builder.Append(" outputBlobUri: "); - builder.AppendLine($"'{OutputBlobUri.AbsoluteUri}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ErrorBlobUri), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" errorBlobUri: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ErrorBlobUri)) - { - builder.Append(" errorBlobUri: "); - builder.AppendLine($"'{ErrorBlobUri.AbsoluteUri}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OutputBlobManagedIdentity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" outputBlobManagedIdentity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(OutputBlobManagedIdentity)) - { - builder.Append(" outputBlobManagedIdentity: "); - BicepSerializationHelpers.AppendChildObject(builder, OutputBlobManagedIdentity, options, 4, false, " outputBlobManagedIdentity: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ErrorBlobManagedIdentity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" errorBlobManagedIdentity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ErrorBlobManagedIdentity)) - { - builder.Append(" errorBlobManagedIdentity: "); - BicepSerializationHelpers.AppendChildObject(builder, ErrorBlobManagedIdentity, options, 4, false, " errorBlobManagedIdentity: "); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" provisioningState: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ProvisioningState)) - { - builder.Append(" provisioningState: "); - if (ProvisioningState.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{ProvisioningState}'''"); - } - else - { - builder.AppendLine($"'{ProvisioningState}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(InstanceView), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" instanceView: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(InstanceView)) - { - builder.Append(" instanceView: "); - BicepSerializationHelpers.AppendChildObject(builder, InstanceView, options, 4, false, " instanceView: "); - } - } - - builder.AppendLine(" }"); - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(MachineRunCommandData)} does not support writing '{options.Format}' format."); - } - } - - MachineRunCommandData 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 DeserializeMachineRunCommandData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MachineRunCommandData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandData.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandData.cs deleted file mode 100644 index d6369c6d0fae5..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandData.cs +++ /dev/null @@ -1,146 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.HybridCompute.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.HybridCompute -{ - /// - /// A class representing the MachineRunCommand data model. - /// Describes a Run Command - /// - public partial class MachineRunCommandData : TrackedResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - /// The location. - public MachineRunCommandData(AzureLocation location) : base(location) - { - Parameters = new ChangeTrackingList(); - ProtectedParameters = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The source of the run command script. - /// The parameters used by the script. - /// The parameters used by the script. - /// Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete. - /// Specifies the user account on the machine when executing the run command. - /// Specifies the user account password on the machine when executing the run command. - /// The timeout in seconds to execute the run command. - /// Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. - /// Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter. - /// User-assigned managed identity that has access to outputBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. - /// User-assigned managed identity that has access to errorBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. - /// The provisioning state, which only appears in the response. - /// The machine run command instance view. - /// Keeps track of any properties unknown to the library. - internal MachineRunCommandData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, MachineRunCommandScriptSource source, IList parameters, IList protectedParameters, bool? asyncExecution, string runAsUser, string runAsPassword, int? timeoutInSeconds, Uri outputBlobUri, Uri errorBlobUri, RunCommandManagedIdentity outputBlobManagedIdentity, RunCommandManagedIdentity errorBlobManagedIdentity, string provisioningState, MachineRunCommandInstanceView instanceView, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) - { - Source = source; - Parameters = parameters; - ProtectedParameters = protectedParameters; - AsyncExecution = asyncExecution; - RunAsUser = runAsUser; - RunAsPassword = runAsPassword; - TimeoutInSeconds = timeoutInSeconds; - OutputBlobUri = outputBlobUri; - ErrorBlobUri = errorBlobUri; - OutputBlobManagedIdentity = outputBlobManagedIdentity; - ErrorBlobManagedIdentity = errorBlobManagedIdentity; - ProvisioningState = provisioningState; - InstanceView = instanceView; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Initializes a new instance of for deserialization. - internal MachineRunCommandData() - { - } - - /// The source of the run command script. - [WirePath("properties.source")] - public MachineRunCommandScriptSource Source { get; set; } - /// The parameters used by the script. - [WirePath("properties.parameters")] - public IList Parameters { get; } - /// The parameters used by the script. - [WirePath("properties.protectedParameters")] - public IList ProtectedParameters { get; } - /// Optional. If set to true, provisioning will complete as soon as script starts and will not wait for script to complete. - [WirePath("properties.asyncExecution")] - public bool? AsyncExecution { get; set; } - /// Specifies the user account on the machine when executing the run command. - [WirePath("properties.runAsUser")] - public string RunAsUser { get; set; } - /// Specifies the user account password on the machine when executing the run command. - [WirePath("properties.runAsPassword")] - public string RunAsPassword { get; set; } - /// The timeout in seconds to execute the run command. - [WirePath("properties.timeoutInSeconds")] - public int? TimeoutInSeconds { get; set; } - /// Specifies the Azure storage blob where script output stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer outputBlobManagedIdentity parameter. - [WirePath("properties.outputBlobUri")] - public Uri OutputBlobUri { get; set; } - /// Specifies the Azure storage blob where script error stream will be uploaded. Use a SAS URI with read, append, create, write access OR use managed identity to provide the VM access to the blob. Refer errorBlobManagedIdentity parameter. - [WirePath("properties.errorBlobUri")] - public Uri ErrorBlobUri { get; set; } - /// User-assigned managed identity that has access to outputBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. - [WirePath("properties.outputBlobManagedIdentity")] - public RunCommandManagedIdentity OutputBlobManagedIdentity { get; set; } - /// User-assigned managed identity that has access to errorBlobUri storage blob. Use an empty object in case of system-assigned identity. Make sure managed identity has been given access to blob's container with 'Storage Blob Data Contributor' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. - [WirePath("properties.errorBlobManagedIdentity")] - public RunCommandManagedIdentity ErrorBlobManagedIdentity { get; set; } - /// The provisioning state, which only appears in the response. - [WirePath("properties.provisioningState")] - public string ProvisioningState { get; } - /// The machine run command instance view. - [WirePath("properties.instanceView")] - public MachineRunCommandInstanceView InstanceView { get; } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandResource.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandResource.Serialization.cs deleted file mode 100644 index 07be5d5c241ad..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.HybridCompute -{ - public partial class MachineRunCommandResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - MachineRunCommandData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - MachineRunCommandData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionsResourceStatus.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionsResourceStatus.Serialization.cs deleted file mode 100644 index 283792a02ff99..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionsResourceStatus.Serialization.cs +++ /dev/null @@ -1,305 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.HybridCompute.Models -{ - public partial class ExtensionsResourceStatus : 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(ExtensionsResourceStatus)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(Code)) - { - writer.WritePropertyName("code"u8); - writer.WriteStringValue(Code); - } - if (Optional.IsDefined(Level)) - { - writer.WritePropertyName("level"u8); - writer.WriteStringValue(Level.Value.ToSerialString()); - } - if (Optional.IsDefined(DisplayStatus)) - { - writer.WritePropertyName("displayStatus"u8); - writer.WriteStringValue(DisplayStatus); - } - if (Optional.IsDefined(Message)) - { - writer.WritePropertyName("message"u8); - writer.WriteStringValue(Message); - } - if (Optional.IsDefined(Time)) - { - writer.WritePropertyName("time"u8); - writer.WriteStringValue(Time.Value, "O"); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - ExtensionsResourceStatus 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(ExtensionsResourceStatus)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeExtensionsResourceStatus(document.RootElement, options); - } - - internal static ExtensionsResourceStatus DeserializeExtensionsResourceStatus(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string code = default; - ExtensionsStatusLevelType? level = default; - string displayStatus = default; - string message = default; - DateTimeOffset? time = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("code"u8)) - { - code = property.Value.GetString(); - continue; - } - if (property.NameEquals("level"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - level = property.Value.GetString().ToExtensionsStatusLevelType(); - continue; - } - if (property.NameEquals("displayStatus"u8)) - { - displayStatus = property.Value.GetString(); - continue; - } - if (property.NameEquals("message"u8)) - { - message = property.Value.GetString(); - continue; - } - if (property.NameEquals("time"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - time = property.Value.GetDateTimeOffset("O"); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new ExtensionsResourceStatus( - code, - level, - displayStatus, - message, - time, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Code), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" code: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Code)) - { - builder.Append(" code: "); - if (Code.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Code}'''"); - } - else - { - builder.AppendLine($"'{Code}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Level), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" level: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Level)) - { - builder.Append(" level: "); - builder.AppendLine($"'{Level.Value.ToSerialString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DisplayStatus), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" displayStatus: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(DisplayStatus)) - { - builder.Append(" displayStatus: "); - if (DisplayStatus.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{DisplayStatus}'''"); - } - else - { - builder.AppendLine($"'{DisplayStatus}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Message), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" message: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Message)) - { - builder.Append(" message: "); - if (Message.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Message}'''"); - } - else - { - builder.AppendLine($"'{Message}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Time), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" time: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Time)) - { - builder.Append(" time: "); - var formattedDateTimeString = TypeFormatters.ToString(Time.Value, "o"); - builder.AppendLine($"'{formattedDateTimeString}'"); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(ExtensionsResourceStatus)} does not support writing '{options.Format}' format."); - } - } - - ExtensionsResourceStatus 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 DeserializeExtensionsResourceStatus(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(ExtensionsResourceStatus)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionsResourceStatus.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionsResourceStatus.cs deleted file mode 100644 index 70e489109b5b6..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionsResourceStatus.cs +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.HybridCompute.Models -{ - /// Instance view status. - public partial class ExtensionsResourceStatus - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal ExtensionsResourceStatus() - { - } - - /// Initializes a new instance of . - /// The status code. - /// The level code. - /// The short localizable label for the status. - /// The detailed status message, including for alerts and error messages. - /// The time of the status. - /// Keeps track of any properties unknown to the library. - internal ExtensionsResourceStatus(string code, ExtensionsStatusLevelType? level, string displayStatus, string message, DateTimeOffset? time, IDictionary serializedAdditionalRawData) - { - Code = code; - Level = level; - DisplayStatus = displayStatus; - Message = message; - Time = time; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// The status code. - [WirePath("code")] - public string Code { get; } - /// The level code. - [WirePath("level")] - public ExtensionsStatusLevelType? Level { get; } - /// The short localizable label for the status. - [WirePath("displayStatus")] - public string DisplayStatus { get; } - /// The detailed status message, including for alerts and error messages. - [WirePath("message")] - public string Message { get; } - /// The time of the status. - [WirePath("time")] - public DateTimeOffset? Time { get; } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionsStatusLevelType.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionsStatusLevelType.Serialization.cs deleted file mode 100644 index 8f03c2a919c94..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionsStatusLevelType.Serialization.cs +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; - -namespace Azure.ResourceManager.HybridCompute.Models -{ - internal static partial class ExtensionsStatusLevelTypeExtensions - { - public static string ToSerialString(this ExtensionsStatusLevelType value) => value switch - { - ExtensionsStatusLevelType.Info => "Info", - ExtensionsStatusLevelType.Warning => "Warning", - ExtensionsStatusLevelType.Error => "Error", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ExtensionsStatusLevelType value.") - }; - - public static ExtensionsStatusLevelType ToExtensionsStatusLevelType(this string value) - { - if (StringComparer.OrdinalIgnoreCase.Equals(value, "Info")) return ExtensionsStatusLevelType.Info; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "Warning")) return ExtensionsStatusLevelType.Warning; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "Error")) return ExtensionsStatusLevelType.Error; - throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown ExtensionsStatusLevelType value."); - } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionsStatusLevelType.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionsStatusLevelType.cs deleted file mode 100644 index d686e042015a9..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionsStatusLevelType.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -namespace Azure.ResourceManager.HybridCompute.Models -{ - /// The level code. - public enum ExtensionsStatusLevelType - { - /// Info. - Info, - /// Warning. - Warning, - /// Error. - Error - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeExecutionState.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeExecutionState.cs deleted file mode 100644 index 578ddd1f2e84c..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeExecutionState.cs +++ /dev/null @@ -1,66 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.HybridCompute.Models -{ - /// Script execution status. - public readonly partial struct HybridComputeExecutionState : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public HybridComputeExecutionState(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string UnknownValue = "Unknown"; - private const string PendingValue = "Pending"; - private const string RunningValue = "Running"; - private const string FailedValue = "Failed"; - private const string SucceededValue = "Succeeded"; - private const string TimedOutValue = "TimedOut"; - private const string CanceledValue = "Canceled"; - - /// Unknown. - public static HybridComputeExecutionState Unknown { get; } = new HybridComputeExecutionState(UnknownValue); - /// Pending. - public static HybridComputeExecutionState Pending { get; } = new HybridComputeExecutionState(PendingValue); - /// Running. - public static HybridComputeExecutionState Running { get; } = new HybridComputeExecutionState(RunningValue); - /// Failed. - public static HybridComputeExecutionState Failed { get; } = new HybridComputeExecutionState(FailedValue); - /// Succeeded. - public static HybridComputeExecutionState Succeeded { get; } = new HybridComputeExecutionState(SucceededValue); - /// TimedOut. - public static HybridComputeExecutionState TimedOut { get; } = new HybridComputeExecutionState(TimedOutValue); - /// Canceled. - public static HybridComputeExecutionState Canceled { get; } = new HybridComputeExecutionState(CanceledValue); - /// Determines if two values are the same. - public static bool operator ==(HybridComputeExecutionState left, HybridComputeExecutionState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(HybridComputeExecutionState left, HybridComputeExecutionState right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator HybridComputeExecutionState(string value) => new HybridComputeExecutionState(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is HybridComputeExecutionState other && Equals(other); - /// - public bool Equals(HybridComputeExecutionState 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/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeGatewayPatch.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeGatewayPatch.Serialization.cs deleted file mode 100644 index 5ce50ad3c40b9..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeGatewayPatch.Serialization.cs +++ /dev/null @@ -1,159 +0,0 @@ -// 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.HybridCompute.Models -{ - public partial class HybridComputeGatewayPatch : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(HybridComputeGatewayPatch)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(AllowedFeatures)) - { - writer.WritePropertyName("allowedFeatures"u8); - writer.WriteStartArray(); - foreach (var item in AllowedFeatures) - { - writer.WriteStringValue(item); - } - writer.WriteEndArray(); - } - writer.WriteEndObject(); - } - - HybridComputeGatewayPatch 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(HybridComputeGatewayPatch)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeHybridComputeGatewayPatch(document.RootElement, options); - } - - internal static HybridComputeGatewayPatch DeserializeHybridComputeGatewayPatch(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IDictionary tags = default; - IList allowedFeatures = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("tags"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - Dictionary dictionary = new Dictionary(); - foreach (var property0 in property.Value.EnumerateObject()) - { - dictionary.Add(property0.Name, property0.Value.GetString()); - } - tags = dictionary; - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("allowedFeatures"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property0.Value.EnumerateArray()) - { - array.Add(item.GetString()); - } - allowedFeatures = array; - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new HybridComputeGatewayPatch(tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, allowedFeatures ?? new ChangeTrackingList()); - } - - 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(HybridComputeGatewayPatch)} does not support writing '{options.Format}' format."); - } - } - - HybridComputeGatewayPatch 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 DeserializeHybridComputeGatewayPatch(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(HybridComputeGatewayPatch)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeGatewayPatch.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeGatewayPatch.cs deleted file mode 100644 index 8912c0a329dd7..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeGatewayPatch.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.HybridCompute.Models -{ - /// Describes a License Update. - public partial class HybridComputeGatewayPatch : HybridComputeResourceUpdate - { - /// Initializes a new instance of . - public HybridComputeGatewayPatch() - { - AllowedFeatures = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Resource tags. - /// Keeps track of any properties unknown to the library. - /// Specifies the list of features that are enabled for this Gateway. - internal HybridComputeGatewayPatch(IDictionary tags, IDictionary serializedAdditionalRawData, IList allowedFeatures) : base(tags, serializedAdditionalRawData) - { - AllowedFeatures = allowedFeatures; - } - - /// Specifies the list of features that are enabled for this Gateway. - [WirePath("properties.allowedFeatures")] - public IList AllowedFeatures { get; } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeGatewayType.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeGatewayType.cs deleted file mode 100644 index 402538f8c3bd5..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeGatewayType.cs +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ComponentModel; - -namespace Azure.ResourceManager.HybridCompute.Models -{ - /// The type of the Gateway resource. - public readonly partial struct HybridComputeGatewayType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public HybridComputeGatewayType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string PublicValue = "Public"; - - /// Public. - public static HybridComputeGatewayType Public { get; } = new HybridComputeGatewayType(PublicValue); - /// Determines if two values are the same. - public static bool operator ==(HybridComputeGatewayType left, HybridComputeGatewayType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(HybridComputeGatewayType left, HybridComputeGatewayType right) => !left.Equals(right); - /// Converts a to a . - public static implicit operator HybridComputeGatewayType(string value) => new HybridComputeGatewayType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is HybridComputeGatewayType other && Equals(other); - /// - public bool Equals(HybridComputeGatewayType 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/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeTargetResourceSettings.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeTargetResourceSettings.Serialization.cs deleted file mode 100644 index c52457969df0f..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeTargetResourceSettings.Serialization.cs +++ /dev/null @@ -1,307 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.HybridCompute.Models -{ - public partial class HybridComputeTargetResourceSettings : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - writer.WriteStartObject(); - JsonModelWriteCore(writer, options); - writer.WriteEndObject(); - } - - /// The JSON writer. - /// The client options for reading and writing models. - protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(HybridComputeTargetResourceSettings)} does not support writing '{format}' format."); - } - - base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(TenantId)) - { - writer.WritePropertyName("tenantId"u8); - writer.WriteStringValue(TenantId.Value); - } - writer.WritePropertyName("gatewayProperties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(GatewayResourceId)) - { - writer.WritePropertyName("gatewayResourceId"u8); - writer.WriteStringValue(GatewayResourceId); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - } - - HybridComputeTargetResourceSettings 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(HybridComputeTargetResourceSettings)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeHybridComputeTargetResourceSettings(document.RootElement, options); - } - - internal static HybridComputeTargetResourceSettings DeserializeHybridComputeTargetResourceSettings(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - ResourceIdentifier id = default; - string name = default; - ResourceType type = default; - SystemData systemData = default; - Guid? tenantId = default; - ResourceIdentifier gatewayResourceId = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("id"u8)) - { - id = new ResourceIdentifier(property.Value.GetString()); - continue; - } - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("type"u8)) - { - type = new ResourceType(property.Value.GetString()); - continue; - } - if (property.NameEquals("systemData"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (property.NameEquals("properties"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property0 in property.Value.EnumerateObject()) - { - if (property0.NameEquals("tenantId"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - tenantId = property0.Value.GetGuid(); - continue; - } - if (property0.NameEquals("gatewayProperties"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property1 in property0.Value.EnumerateObject()) - { - if (property1.NameEquals("gatewayResourceId"u8)) - { - if (property1.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - gatewayResourceId = new ResourceIdentifier(property1.Value.GetString()); - continue; - } - } - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new HybridComputeTargetResourceSettings( - id, - name, - type, - systemData, - tenantId, - gatewayResourceId, - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" id: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Id)) - { - builder.Append(" id: "); - builder.AppendLine($"'{Id.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" systemData: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(SystemData)) - { - builder.Append(" systemData: "); - builder.AppendLine($"'{SystemData.ToString()}'"); - } - } - - builder.Append(" properties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TenantId), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" tenantId: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(TenantId)) - { - builder.Append(" tenantId: "); - builder.AppendLine($"'{TenantId.Value.ToString()}'"); - } - } - - builder.Append(" gatewayProperties:"); - builder.AppendLine(" {"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(GatewayResourceId), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" gatewayResourceId: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(GatewayResourceId)) - { - builder.Append(" gatewayResourceId: "); - builder.AppendLine($"'{GatewayResourceId.ToString()}'"); - } - } - - builder.AppendLine(" }"); - builder.AppendLine(" }"); - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(HybridComputeTargetResourceSettings)} does not support writing '{options.Format}' format."); - } - } - - HybridComputeTargetResourceSettings 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 DeserializeHybridComputeTargetResourceSettings(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(HybridComputeTargetResourceSettings)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeTargetResourceSettings.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeTargetResourceSettings.cs deleted file mode 100644 index d0cbb1bbf41c0..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeTargetResourceSettings.cs +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; -using Azure.Core; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.HybridCompute.Models -{ - /// The HybridComputeTargetResourceSettings. - public partial class HybridComputeTargetResourceSettings : ResourceData - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - public HybridComputeTargetResourceSettings() - { - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Azure resource tenant Id. - /// Associated Gateway Resource Id. - /// Keeps track of any properties unknown to the library. - internal HybridComputeTargetResourceSettings(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, Guid? tenantId, ResourceIdentifier gatewayResourceId, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) - { - TenantId = tenantId; - GatewayResourceId = gatewayResourceId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Azure resource tenant Id. - [WirePath("properties.tenantId")] - public Guid? TenantId { get; } - /// Associated Gateway Resource Id. - [WirePath("properties.gatewayResourceId")] - public ResourceIdentifier GatewayResourceId { get; set; } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfilePatch.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfilePatch.Serialization.cs new file mode 100644 index 0000000000000..71cd28e866916 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfilePatch.Serialization.cs @@ -0,0 +1,267 @@ +// 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.HybridCompute.Models +{ + public partial class LicenseProfilePatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LicenseProfilePatch)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + writer.WritePropertyName("productProfile"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(SubscriptionStatus)) + { + writer.WritePropertyName("subscriptionStatus"u8); + writer.WriteStringValue(SubscriptionStatus.Value.ToString()); + } + if (Optional.IsDefined(ProductType)) + { + writer.WritePropertyName("productType"u8); + writer.WriteStringValue(ProductType.Value.ToString()); + } + if (Optional.IsCollectionDefined(ProductFeatures)) + { + writer.WritePropertyName("productFeatures"u8); + writer.WriteStartArray(); + foreach (var item in ProductFeatures) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + writer.WritePropertyName("esuProfile"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(AssignedLicense)) + { + writer.WritePropertyName("assignedLicense"u8); + writer.WriteStringValue(AssignedLicense); + } + writer.WriteEndObject(); + writer.WritePropertyName("softwareAssurance"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(SoftwareAssuranceCustomer)) + { + writer.WritePropertyName("softwareAssuranceCustomer"u8); + writer.WriteBooleanValue(SoftwareAssuranceCustomer.Value); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + LicenseProfilePatch 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(LicenseProfilePatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLicenseProfilePatch(document.RootElement, options); + } + + internal static LicenseProfilePatch DeserializeLicenseProfilePatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + LicenseProfileSubscriptionStatusUpdate? subscriptionStatus = default; + LicenseProfileProductType? productType = default; + IList productFeatures = default; + string assignedLicense = default; + bool? softwareAssuranceCustomer = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("productProfile"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property1 in property0.Value.EnumerateObject()) + { + if (property1.NameEquals("subscriptionStatus"u8)) + { + if (property1.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + subscriptionStatus = new LicenseProfileSubscriptionStatusUpdate(property1.Value.GetString()); + continue; + } + if (property1.NameEquals("productType"u8)) + { + if (property1.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + productType = new LicenseProfileProductType(property1.Value.GetString()); + continue; + } + if (property1.NameEquals("productFeatures"u8)) + { + if (property1.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property1.Value.EnumerateArray()) + { + array.Add(ProductFeatureUpdate.DeserializeProductFeatureUpdate(item, options)); + } + productFeatures = array; + continue; + } + } + continue; + } + if (property0.NameEquals("esuProfile"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property1 in property0.Value.EnumerateObject()) + { + if (property1.NameEquals("assignedLicense"u8)) + { + assignedLicense = property1.Value.GetString(); + continue; + } + } + continue; + } + if (property0.NameEquals("softwareAssurance"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property1 in property0.Value.EnumerateObject()) + { + if (property1.NameEquals("softwareAssuranceCustomer"u8)) + { + if (property1.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + softwareAssuranceCustomer = property1.Value.GetBoolean(); + continue; + } + } + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LicenseProfilePatch( + tags ?? new ChangeTrackingDictionary(), + serializedAdditionalRawData, + subscriptionStatus, + productType, + productFeatures ?? new ChangeTrackingList(), + assignedLicense, + softwareAssuranceCustomer); + } + + 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(LicenseProfilePatch)} does not support writing '{options.Format}' format."); + } + } + + LicenseProfilePatch 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 DeserializeLicenseProfilePatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LicenseProfilePatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfilePatch.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfilePatch.cs new file mode 100644 index 0000000000000..0160af1bf9591 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfilePatch.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// Describes a License Profile Update. + public partial class LicenseProfilePatch : HybridComputeResourceUpdate + { + /// Initializes a new instance of . + public LicenseProfilePatch() + { + ProductFeatures = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Resource tags. + /// Keeps track of any properties unknown to the library. + /// Indicates the subscription status of the product. + /// Indicates the product type of the license. + /// The list of product feature updates. + /// The resource id of the license. + /// Specifies if this machine is licensed as part of a Software Assurance agreement. + internal LicenseProfilePatch(IDictionary tags, IDictionary serializedAdditionalRawData, LicenseProfileSubscriptionStatusUpdate? subscriptionStatus, LicenseProfileProductType? productType, IList productFeatures, string assignedLicense, bool? softwareAssuranceCustomer) : base(tags, serializedAdditionalRawData) + { + SubscriptionStatus = subscriptionStatus; + ProductType = productType; + ProductFeatures = productFeatures; + AssignedLicense = assignedLicense; + SoftwareAssuranceCustomer = softwareAssuranceCustomer; + } + + /// Indicates the subscription status of the product. + [WirePath("properties.subscriptionStatus")] + public LicenseProfileSubscriptionStatusUpdate? SubscriptionStatus { get; set; } + /// Indicates the product type of the license. + [WirePath("properties.productType")] + public LicenseProfileProductType? ProductType { get; set; } + /// The list of product feature updates. + [WirePath("properties.productFeatures")] + public IList ProductFeatures { get; } + /// The resource id of the license. + [WirePath("properties.assignedLicense")] + public string AssignedLicense { get; set; } + /// Specifies if this machine is licensed as part of a Software Assurance agreement. + [WirePath("properties.softwareAssuranceCustomer")] + public bool? SoftwareAssuranceCustomer { get; set; } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileSubscriptionStatusUpdate.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileSubscriptionStatusUpdate.cs new file mode 100644 index 0000000000000..d464e071a741b --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileSubscriptionStatusUpdate.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.HybridCompute.Models +{ + /// Indicates the new subscription status of the OS or Product Features. + public readonly partial struct LicenseProfileSubscriptionStatusUpdate : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public LicenseProfileSubscriptionStatusUpdate(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnableValue = "Enable"; + private const string DisableValue = "Disable"; + + /// Enable. + public static LicenseProfileSubscriptionStatusUpdate Enable { get; } = new LicenseProfileSubscriptionStatusUpdate(EnableValue); + /// Disable. + public static LicenseProfileSubscriptionStatusUpdate Disable { get; } = new LicenseProfileSubscriptionStatusUpdate(DisableValue); + /// Determines if two values are the same. + public static bool operator ==(LicenseProfileSubscriptionStatusUpdate left, LicenseProfileSubscriptionStatusUpdate right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(LicenseProfileSubscriptionStatusUpdate left, LicenseProfileSubscriptionStatusUpdate right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator LicenseProfileSubscriptionStatusUpdate(string value) => new LicenseProfileSubscriptionStatusUpdate(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is LicenseProfileSubscriptionStatusUpdate other && Equals(other); + /// + public bool Equals(LicenseProfileSubscriptionStatusUpdate 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/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewaysListResult.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfilesListResult.Serialization.cs similarity index 74% rename from sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewaysListResult.Serialization.cs rename to sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfilesListResult.Serialization.cs index 051354f319b0f..222cda4eb76cd 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewaysListResult.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfilesListResult.Serialization.cs @@ -15,11 +15,11 @@ namespace Azure.ResourceManager.HybridCompute.Models { - internal partial class GatewaysListResult : IUtf8JsonSerializable, IJsonModel + internal partial class LicenseProfilesListResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -30,10 +30,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(GatewaysListResult)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(LicenseProfilesListResult)} does not support writing '{format}' format."); } writer.WritePropertyName("value"u8); @@ -65,19 +65,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - GatewaysListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + LicenseProfilesListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(GatewaysListResult)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(LicenseProfilesListResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeGatewaysListResult(document.RootElement, options); + return DeserializeLicenseProfilesListResult(document.RootElement, options); } - internal static GatewaysListResult DeserializeGatewaysListResult(JsonElement element, ModelReaderWriterOptions options = null) + internal static LicenseProfilesListResult DeserializeLicenseProfilesListResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -85,7 +85,7 @@ internal static GatewaysListResult DeserializeGatewaysListResult(JsonElement ele { return null; } - IReadOnlyList value = default; + IReadOnlyList value = default; string nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -93,10 +93,10 @@ internal static GatewaysListResult DeserializeGatewaysListResult(JsonElement ele { if (property.NameEquals("value"u8)) { - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(HybridComputeGatewayData.DeserializeHybridComputeGatewayData(item, options)); + array.Add(LicenseProfileData.DeserializeLicenseProfileData(item, options)); } value = array; continue; @@ -112,7 +112,7 @@ internal static GatewaysListResult DeserializeGatewaysListResult(JsonElement ele } } serializedAdditionalRawData = rawDataDictionary; - return new GatewaysListResult(value, nextLink, serializedAdditionalRawData); + return new LicenseProfilesListResult(value, nextLink, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -176,9 +176,9 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) return BinaryData.FromString(builder.ToString()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { @@ -187,26 +187,26 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(GatewaysListResult)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(LicenseProfilesListResult)} does not support writing '{options.Format}' format."); } } - GatewaysListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + LicenseProfilesListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeGatewaysListResult(document.RootElement, options); + return DeserializeLicenseProfilesListResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(GatewaysListResult)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(LicenseProfilesListResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewaysListResult.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfilesListResult.cs similarity index 63% rename from sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewaysListResult.cs rename to sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfilesListResult.cs index 3107e4575849d..57170847a2308 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewaysListResult.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfilesListResult.cs @@ -11,8 +11,8 @@ namespace Azure.ResourceManager.HybridCompute.Models { - /// The List license operation response. - internal partial class GatewaysListResult + /// The List hybrid machine license profile operation response. + internal partial class LicenseProfilesListResult { /// /// Keeps track of any properties unknown to the library. @@ -46,35 +46,35 @@ internal partial class GatewaysListResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The list of Gateways. + /// Initializes a new instance of . + /// The list of license profiles. /// is null. - internal GatewaysListResult(IEnumerable value) + internal LicenseProfilesListResult(IEnumerable value) { Argument.AssertNotNull(value, nameof(value)); Value = value.ToList(); } - /// Initializes a new instance of . - /// The list of Gateways. - /// The URI to fetch the next page of Gateways. Call ListNext() with this URI to fetch the next page of Gateways. + /// Initializes a new instance of . + /// The list of license profiles. + /// The URI to fetch the next page of Machines. Call ListNext() with this URI to fetch the next page of license profile. /// Keeps track of any properties unknown to the library. - internal GatewaysListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal LicenseProfilesListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal GatewaysListResult() + /// Initializes a new instance of for deserialization. + internal LicenseProfilesListResult() { } - /// The list of Gateways. - public IReadOnlyList Value { get; } - /// The URI to fetch the next page of Gateways. Call ListNext() with this URI to fetch the next page of Gateways. + /// The list of license profiles. + public IReadOnlyList Value { get; } + /// The URI to fetch the next page of Machines. Call ListNext() with this URI to fetch the next page of license profile. public string NextLink { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandInstanceView.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandInstanceView.Serialization.cs deleted file mode 100644 index 7530d6c203cf8..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandInstanceView.Serialization.cs +++ /dev/null @@ -1,418 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.HybridCompute.Models -{ - public partial class MachineRunCommandInstanceView : 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(MachineRunCommandInstanceView)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(ExecutionState)) - { - writer.WritePropertyName("executionState"u8); - writer.WriteStringValue(ExecutionState.Value.ToString()); - } - if (Optional.IsDefined(ExecutionMessage)) - { - writer.WritePropertyName("executionMessage"u8); - writer.WriteStringValue(ExecutionMessage); - } - if (Optional.IsDefined(ExitCode)) - { - writer.WritePropertyName("exitCode"u8); - writer.WriteNumberValue(ExitCode.Value); - } - if (Optional.IsDefined(Output)) - { - writer.WritePropertyName("output"u8); - writer.WriteStringValue(Output); - } - if (Optional.IsDefined(Error)) - { - writer.WritePropertyName("error"u8); - writer.WriteStringValue(Error); - } - if (Optional.IsDefined(StartOn)) - { - writer.WritePropertyName("startTime"u8); - writer.WriteStringValue(StartOn.Value, "O"); - } - if (Optional.IsDefined(EndOn)) - { - writer.WritePropertyName("endTime"u8); - writer.WriteStringValue(EndOn.Value, "O"); - } - if (Optional.IsCollectionDefined(Statuses)) - { - writer.WritePropertyName("statuses"u8); - writer.WriteStartArray(); - foreach (var item in Statuses) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - MachineRunCommandInstanceView 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(MachineRunCommandInstanceView)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMachineRunCommandInstanceView(document.RootElement, options); - } - - internal static MachineRunCommandInstanceView DeserializeMachineRunCommandInstanceView(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - HybridComputeExecutionState? executionState = default; - string executionMessage = default; - int? exitCode = default; - string output = default; - string error = default; - DateTimeOffset? startTime = default; - DateTimeOffset? endTime = default; - IReadOnlyList statuses = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("executionState"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - executionState = new HybridComputeExecutionState(property.Value.GetString()); - continue; - } - if (property.NameEquals("executionMessage"u8)) - { - executionMessage = property.Value.GetString(); - continue; - } - if (property.NameEquals("exitCode"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - exitCode = property.Value.GetInt32(); - continue; - } - if (property.NameEquals("output"u8)) - { - output = property.Value.GetString(); - continue; - } - if (property.NameEquals("error"u8)) - { - error = property.Value.GetString(); - continue; - } - if (property.NameEquals("startTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - startTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("endTime"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - endTime = property.Value.GetDateTimeOffset("O"); - continue; - } - if (property.NameEquals("statuses"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(ExtensionsResourceStatus.DeserializeExtensionsResourceStatus(item, options)); - } - statuses = array; - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MachineRunCommandInstanceView( - executionState, - executionMessage, - exitCode, - output, - error, - startTime, - endTime, - statuses ?? new ChangeTrackingList(), - serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ExecutionState), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" executionState: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ExecutionState)) - { - builder.Append(" executionState: "); - builder.AppendLine($"'{ExecutionState.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ExecutionMessage), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" executionMessage: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ExecutionMessage)) - { - builder.Append(" executionMessage: "); - if (ExecutionMessage.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{ExecutionMessage}'''"); - } - else - { - builder.AppendLine($"'{ExecutionMessage}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ExitCode), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" exitCode: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ExitCode)) - { - builder.Append(" exitCode: "); - builder.AppendLine($"{ExitCode.Value}"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Output), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" output: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Output)) - { - builder.Append(" output: "); - if (Output.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Output}'''"); - } - else - { - builder.AppendLine($"'{Output}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Error), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" error: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Error)) - { - builder.Append(" error: "); - if (Error.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Error}'''"); - } - else - { - builder.AppendLine($"'{Error}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(StartOn), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" startTime: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(StartOn)) - { - builder.Append(" startTime: "); - var formattedDateTimeString = TypeFormatters.ToString(StartOn.Value, "o"); - builder.AppendLine($"'{formattedDateTimeString}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EndOn), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" endTime: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(EndOn)) - { - builder.Append(" endTime: "); - var formattedDateTimeString = TypeFormatters.ToString(EndOn.Value, "o"); - builder.AppendLine($"'{formattedDateTimeString}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Statuses), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" statuses: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Statuses)) - { - if (Statuses.Any()) - { - builder.Append(" statuses: "); - builder.AppendLine("["); - foreach (var item in Statuses) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " statuses: "); - } - builder.AppendLine(" ]"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(MachineRunCommandInstanceView)} does not support writing '{options.Format}' format."); - } - } - - MachineRunCommandInstanceView 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 DeserializeMachineRunCommandInstanceView(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MachineRunCommandInstanceView)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandInstanceView.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandInstanceView.cs deleted file mode 100644 index 7d4e909db720b..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandInstanceView.cs +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.HybridCompute.Models -{ - /// The instance view of a machine run command. - public partial class MachineRunCommandInstanceView - { - /// - /// Keeps track of any properties unknown to the library. - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - private IDictionary _serializedAdditionalRawData; - - /// Initializes a new instance of . - internal MachineRunCommandInstanceView() - { - Statuses = new ChangeTrackingList(); - } - - /// Initializes a new instance of . - /// Script execution status. - /// Communicate script configuration errors or execution messages. - /// Exit code returned from script execution. - /// Script output stream. - /// Script error stream. - /// Script start time. - /// Script end time. - /// The status information. - /// Keeps track of any properties unknown to the library. - internal MachineRunCommandInstanceView(HybridComputeExecutionState? executionState, string executionMessage, int? exitCode, string output, string error, DateTimeOffset? startOn, DateTimeOffset? endOn, IReadOnlyList statuses, IDictionary serializedAdditionalRawData) - { - ExecutionState = executionState; - ExecutionMessage = executionMessage; - ExitCode = exitCode; - Output = output; - Error = error; - StartOn = startOn; - EndOn = endOn; - Statuses = statuses; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Script execution status. - [WirePath("executionState")] - public HybridComputeExecutionState? ExecutionState { get; } - /// Communicate script configuration errors or execution messages. - [WirePath("executionMessage")] - public string ExecutionMessage { get; } - /// Exit code returned from script execution. - [WirePath("exitCode")] - public int? ExitCode { get; } - /// Script output stream. - [WirePath("output")] - public string Output { get; } - /// Script error stream. - [WirePath("error")] - public string Error { get; } - /// Script start time. - [WirePath("startTime")] - public DateTimeOffset? StartOn { get; } - /// Script end time. - [WirePath("endTime")] - public DateTimeOffset? EndOn { get; } - /// The status information. - [WirePath("statuses")] - public IReadOnlyList Statuses { get; } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandScriptSource.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandScriptSource.Serialization.cs deleted file mode 100644 index b384126ebc019..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandScriptSource.Serialization.cs +++ /dev/null @@ -1,264 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.HybridCompute.Models -{ - public partial class MachineRunCommandScriptSource : 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(MachineRunCommandScriptSource)} does not support writing '{format}' format."); - } - - if (Optional.IsDefined(Script)) - { - writer.WritePropertyName("script"u8); - writer.WriteStringValue(Script); - } - if (Optional.IsDefined(ScriptUri)) - { - writer.WritePropertyName("scriptUri"u8); - writer.WriteStringValue(ScriptUri.AbsoluteUri); - } - if (Optional.IsDefined(CommandId)) - { - writer.WritePropertyName("commandId"u8); - writer.WriteStringValue(CommandId); - } - if (Optional.IsDefined(ScriptUriManagedIdentity)) - { - writer.WritePropertyName("scriptUriManagedIdentity"u8); - writer.WriteObjectValue(ScriptUriManagedIdentity, 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 - } - } - } - - MachineRunCommandScriptSource 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(MachineRunCommandScriptSource)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMachineRunCommandScriptSource(document.RootElement, options); - } - - internal static MachineRunCommandScriptSource DeserializeMachineRunCommandScriptSource(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string script = default; - Uri scriptUri = default; - string commandId = default; - RunCommandManagedIdentity scriptUriManagedIdentity = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("script"u8)) - { - script = property.Value.GetString(); - continue; - } - if (property.NameEquals("scriptUri"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - scriptUri = new Uri(property.Value.GetString()); - continue; - } - if (property.NameEquals("commandId"u8)) - { - commandId = property.Value.GetString(); - continue; - } - if (property.NameEquals("scriptUriManagedIdentity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - scriptUriManagedIdentity = RunCommandManagedIdentity.DeserializeRunCommandManagedIdentity(property.Value, options); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MachineRunCommandScriptSource(script, scriptUri, commandId, scriptUriManagedIdentity, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Script), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" script: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Script)) - { - builder.Append(" script: "); - if (Script.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Script}'''"); - } - else - { - builder.AppendLine($"'{Script}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ScriptUri), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" scriptUri: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ScriptUri)) - { - builder.Append(" scriptUri: "); - builder.AppendLine($"'{ScriptUri.AbsoluteUri}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CommandId), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" commandId: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(CommandId)) - { - builder.Append(" commandId: "); - if (CommandId.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{CommandId}'''"); - } - else - { - builder.AppendLine($"'{CommandId}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ScriptUriManagedIdentity), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" scriptUriManagedIdentity: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ScriptUriManagedIdentity)) - { - builder.Append(" scriptUriManagedIdentity: "); - BicepSerializationHelpers.AppendChildObject(builder, ScriptUriManagedIdentity, options, 2, false, " scriptUriManagedIdentity: "); - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(MachineRunCommandScriptSource)} does not support writing '{options.Format}' format."); - } - } - - MachineRunCommandScriptSource 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 DeserializeMachineRunCommandScriptSource(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MachineRunCommandScriptSource)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandScriptSource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandScriptSource.cs deleted file mode 100644 index 2e5fc9bf1ee37..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandScriptSource.cs +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.HybridCompute.Models -{ - /// Describes the script sources for run command. Use only one of script, scriptUri, commandId. - public partial class MachineRunCommandScriptSource - { - /// - /// 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 MachineRunCommandScriptSource() - { - } - - /// Initializes a new instance of . - /// Specifies the script content to be executed on the machine. - /// Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI. - /// Specifies the commandId of predefined built-in script. - /// User-assigned managed identity that has access to scriptUri in case of Azure storage blob. Use an empty object in case of system-assigned identity. Make sure the Azure storage blob exists, and managed identity has been given access to blob's container with 'Storage Blob Data Reader' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. - /// Keeps track of any properties unknown to the library. - internal MachineRunCommandScriptSource(string script, Uri scriptUri, string commandId, RunCommandManagedIdentity scriptUriManagedIdentity, IDictionary serializedAdditionalRawData) - { - Script = script; - ScriptUri = scriptUri; - CommandId = commandId; - ScriptUriManagedIdentity = scriptUriManagedIdentity; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Specifies the script content to be executed on the machine. - [WirePath("script")] - public string Script { get; set; } - /// Specifies the script download location. It can be either SAS URI of an Azure storage blob with read access or public URI. - [WirePath("scriptUri")] - public Uri ScriptUri { get; set; } - /// Specifies the commandId of predefined built-in script. - [WirePath("commandId")] - public string CommandId { get; set; } - /// User-assigned managed identity that has access to scriptUri in case of Azure storage blob. Use an empty object in case of system-assigned identity. Make sure the Azure storage blob exists, and managed identity has been given access to blob's container with 'Storage Blob Data Reader' role assignment. In case of user-assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. - [WirePath("scriptUriManagedIdentity")] - public RunCommandManagedIdentity ScriptUriManagedIdentity { get; set; } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandsListResult.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandsListResult.Serialization.cs deleted file mode 100644 index bc9fb76f71b2f..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandsListResult.Serialization.cs +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.HybridCompute.Models -{ - internal partial class MachineRunCommandsListResult : 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(MachineRunCommandsListResult)} does not support writing '{format}' format."); - } - - if (Optional.IsCollectionDefined(Value)) - { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(NextLink)) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - } - - MachineRunCommandsListResult 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(MachineRunCommandsListResult)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeMachineRunCommandsListResult(document.RootElement, options); - } - - internal static MachineRunCommandsListResult DeserializeMachineRunCommandsListResult(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IReadOnlyList value = default; - string nextLink = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("value"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); - foreach (var item in property.Value.EnumerateArray()) - { - array.Add(MachineRunCommandData.DeserializeMachineRunCommandData(item, options)); - } - value = array; - continue; - } - if (property.NameEquals("nextLink"u8)) - { - nextLink = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new MachineRunCommandsListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" value: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsCollectionDefined(Value)) - { - if (Value.Any()) - { - builder.Append(" value: "); - builder.AppendLine("["); - foreach (var item in Value) - { - BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); - } - builder.AppendLine(" ]"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NextLink), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" nextLink: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(NextLink)) - { - builder.Append(" nextLink: "); - if (NextLink.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{NextLink}'''"); - } - else - { - builder.AppendLine($"'{NextLink}'"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(MachineRunCommandsListResult)} does not support writing '{options.Format}' format."); - } - } - - MachineRunCommandsListResult 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 DeserializeMachineRunCommandsListResult(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(MachineRunCommandsListResult)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandManagedIdentity.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/NetworkSecurityPerimeterConfigurationReconcileResult.Serialization.cs similarity index 55% rename from sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandManagedIdentity.Serialization.cs rename to sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/NetworkSecurityPerimeterConfigurationReconcileResult.Serialization.cs index 66e7e25578207..1cb9c88c452e2 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandManagedIdentity.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/NetworkSecurityPerimeterConfigurationReconcileResult.Serialization.cs @@ -14,11 +14,11 @@ namespace Azure.ResourceManager.HybridCompute.Models { - public partial class RunCommandManagedIdentity : IUtf8JsonSerializable, IJsonModel + public partial class NetworkSecurityPerimeterConfigurationReconcileResult : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -29,21 +29,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(RunCommandManagedIdentity)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationReconcileResult)} does not support writing '{format}' format."); } - if (Optional.IsDefined(ClientId)) + if (Optional.IsDefined(Location)) { - writer.WritePropertyName("clientId"u8); - writer.WriteStringValue(ClientId.Value); - } - if (Optional.IsDefined(ObjectId)) - { - writer.WritePropertyName("objectId"u8); - writer.WriteStringValue(ObjectId.Value); + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location.Value); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -62,19 +57,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - RunCommandManagedIdentity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + NetworkSecurityPerimeterConfigurationReconcileResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(RunCommandManagedIdentity)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationReconcileResult)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRunCommandManagedIdentity(document.RootElement, options); + return DeserializeNetworkSecurityPerimeterConfigurationReconcileResult(document.RootElement, options); } - internal static RunCommandManagedIdentity DeserializeRunCommandManagedIdentity(JsonElement element, ModelReaderWriterOptions options = null) + internal static NetworkSecurityPerimeterConfigurationReconcileResult DeserializeNetworkSecurityPerimeterConfigurationReconcileResult(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -82,28 +77,18 @@ internal static RunCommandManagedIdentity DeserializeRunCommandManagedIdentity(J { return null; } - Guid? clientId = default; - Guid? objectId = default; + AzureLocation? location = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("clientId"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - clientId = property.Value.GetGuid(); - continue; - } - if (property.NameEquals("objectId"u8)) + if (property.NameEquals("location"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - objectId = property.Value.GetGuid(); + location = new AzureLocation(property.Value.GetString()); continue; } if (options.Format != "W") @@ -112,7 +97,7 @@ internal static RunCommandManagedIdentity DeserializeRunCommandManagedIdentity(J } } serializedAdditionalRawData = rawDataDictionary; - return new RunCommandManagedIdentity(clientId, objectId, serializedAdditionalRawData); + return new NetworkSecurityPerimeterConfigurationReconcileResult(location, serializedAdditionalRawData); } private BinaryData SerializeBicep(ModelReaderWriterOptions options) @@ -126,33 +111,18 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) builder.AppendLine("{"); - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ClientId), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" clientId: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(ClientId)) - { - builder.Append(" clientId: "); - builder.AppendLine($"'{ClientId.Value.ToString()}'"); - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ObjectId), out propertyOverride); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); if (hasPropertyOverride) { - builder.Append(" objectId: "); + builder.Append(" location: "); builder.AppendLine(propertyOverride); } else { - if (Optional.IsDefined(ObjectId)) + if (Optional.IsDefined(Location)) { - builder.Append(" objectId: "); - builder.AppendLine($"'{ObjectId.Value.ToString()}'"); + builder.Append(" location: "); + builder.AppendLine($"'{Location.Value.ToString()}'"); } } @@ -160,9 +130,9 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) return BinaryData.FromString(builder.ToString()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { @@ -171,26 +141,26 @@ BinaryData IPersistableModel.Write(ModelReaderWriterO case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(RunCommandManagedIdentity)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationReconcileResult)} does not support writing '{options.Format}' format."); } } - RunCommandManagedIdentity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + NetworkSecurityPerimeterConfigurationReconcileResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeRunCommandManagedIdentity(document.RootElement, options); + return DeserializeNetworkSecurityPerimeterConfigurationReconcileResult(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(RunCommandManagedIdentity)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationReconcileResult)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandsListResult.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/NetworkSecurityPerimeterConfigurationReconcileResult.cs similarity index 60% rename from sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandsListResult.cs rename to sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/NetworkSecurityPerimeterConfigurationReconcileResult.cs index 259a29d2891d7..17e515409c44b 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandsListResult.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/NetworkSecurityPerimeterConfigurationReconcileResult.cs @@ -7,11 +7,12 @@ using System; using System.Collections.Generic; +using Azure.Core; namespace Azure.ResourceManager.HybridCompute.Models { - /// Describes the Run Commands List Result. - internal partial class MachineRunCommandsListResult + /// Result of network security perimeter configurations. + public partial class NetworkSecurityPerimeterConfigurationReconcileResult { /// /// Keeps track of any properties unknown to the library. @@ -45,26 +46,22 @@ internal partial class MachineRunCommandsListResult /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal MachineRunCommandsListResult() + /// Initializes a new instance of . + internal NetworkSecurityPerimeterConfigurationReconcileResult() { - Value = new ChangeTrackingList(); } - /// Initializes a new instance of . - /// The list of run commands. - /// The uri to fetch the next page of run commands. Call ListNext() with this to fetch the next page of run commands. + /// Initializes a new instance of . + /// The URL of the resource used to check the status of the asynchronous operation. /// Keeps track of any properties unknown to the library. - internal MachineRunCommandsListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal NetworkSecurityPerimeterConfigurationReconcileResult(AzureLocation? location, IDictionary serializedAdditionalRawData) { - Value = value; - NextLink = nextLink; + Location = location; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The list of run commands. - public IReadOnlyList Value { get; } - /// The uri to fetch the next page of run commands. Call ListNext() with this to fetch the next page of run commands. - public string NextLink { get; } + /// The URL of the resource used to check the status of the asynchronous operation. + [WirePath("location")] + public AzureLocation? Location { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ProductFeatureUpdate.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ProductFeatureUpdate.Serialization.cs new file mode 100644 index 0000000000000..c700473a1b7db --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ProductFeatureUpdate.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + public partial class ProductFeatureUpdate : 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(ProductFeatureUpdate)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(SubscriptionStatus)) + { + writer.WritePropertyName("subscriptionStatus"u8); + writer.WriteStringValue(SubscriptionStatus.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ProductFeatureUpdate 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(ProductFeatureUpdate)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProductFeatureUpdate(document.RootElement, options); + } + + internal static ProductFeatureUpdate DeserializeProductFeatureUpdate(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + LicenseProfileSubscriptionStatusUpdate? subscriptionStatus = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("subscriptionStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + subscriptionStatus = new LicenseProfileSubscriptionStatusUpdate(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ProductFeatureUpdate(name, subscriptionStatus, 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(ProductFeatureUpdate)} does not support writing '{options.Format}' format."); + } + } + + ProductFeatureUpdate 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 DeserializeProductFeatureUpdate(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProductFeatureUpdate)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandInputParameter.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ProductFeatureUpdate.cs similarity index 55% rename from sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandInputParameter.cs rename to sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ProductFeatureUpdate.cs index 055d761f88858..5b65490daeae3 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandInputParameter.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ProductFeatureUpdate.cs @@ -10,8 +10,8 @@ namespace Azure.ResourceManager.HybridCompute.Models { - /// Describes the properties of a run command parameter. - public partial class RunCommandInputParameter + /// Product Feature. + public partial class ProductFeatureUpdate { /// /// Keeps track of any properties unknown to the library. @@ -45,40 +45,27 @@ public partial class RunCommandInputParameter /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - /// The run command parameter name. - /// The run command parameter value. - /// or is null. - public RunCommandInputParameter(string name, string value) + /// Initializes a new instance of . + public ProductFeatureUpdate() { - Argument.AssertNotNull(name, nameof(name)); - Argument.AssertNotNull(value, nameof(value)); - - Name = name; - Value = value; } - /// Initializes a new instance of . - /// The run command parameter name. - /// The run command parameter value. + /// Initializes a new instance of . + /// Product feature name. + /// Indicates the new status of the product feature. /// Keeps track of any properties unknown to the library. - internal RunCommandInputParameter(string name, string value, IDictionary serializedAdditionalRawData) + internal ProductFeatureUpdate(string name, LicenseProfileSubscriptionStatusUpdate? subscriptionStatus, IDictionary serializedAdditionalRawData) { Name = name; - Value = value; + SubscriptionStatus = subscriptionStatus; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal RunCommandInputParameter() - { - } - - /// The run command parameter name. + /// Product feature name. [WirePath("name")] public string Name { get; set; } - /// The run command parameter value. - [WirePath("value")] - public string Value { get; set; } + /// Indicates the new status of the product feature. + [WirePath("subscriptionStatus")] + public LicenseProfileSubscriptionStatusUpdate? SubscriptionStatus { get; set; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandInputParameter.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandInputParameter.Serialization.cs deleted file mode 100644 index fc81240deaae7..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandInputParameter.Serialization.cs +++ /dev/null @@ -1,198 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using Azure.Core; - -namespace Azure.ResourceManager.HybridCompute.Models -{ - public partial class RunCommandInputParameter : 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(RunCommandInputParameter)} does not support writing '{format}' format."); - } - - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - writer.WritePropertyName("value"u8); - writer.WriteStringValue(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 - } - } - } - - RunCommandInputParameter 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(RunCommandInputParameter)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeRunCommandInputParameter(document.RootElement, options); - } - - internal static RunCommandInputParameter DeserializeRunCommandInputParameter(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - string name = default; - string value = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("name"u8)) - { - name = property.Value.GetString(); - continue; - } - if (property.NameEquals("value"u8)) - { - value = property.Value.GetString(); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new RunCommandInputParameter(name, value, serializedAdditionalRawData); - } - - private BinaryData SerializeBicep(ModelReaderWriterOptions options) - { - StringBuilder builder = new StringBuilder(); - BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; - IDictionary propertyOverrides = null; - bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); - bool hasPropertyOverride = false; - string propertyOverride = null; - - builder.AppendLine("{"); - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" name: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Name)) - { - builder.Append(" name: "); - if (Name.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Name}'''"); - } - else - { - builder.AppendLine($"'{Name}'"); - } - } - } - - hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Value), out propertyOverride); - if (hasPropertyOverride) - { - builder.Append(" value: "); - builder.AppendLine(propertyOverride); - } - else - { - if (Optional.IsDefined(Value)) - { - builder.Append(" value: "); - if (Value.Contains(Environment.NewLine)) - { - builder.AppendLine("'''"); - builder.AppendLine($"{Value}'''"); - } - else - { - builder.AppendLine($"'{Value}'"); - } - } - } - - builder.AppendLine("}"); - return BinaryData.FromString(builder.ToString()); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - case "bicep": - return SerializeBicep(options); - default: - throw new FormatException($"The model {nameof(RunCommandInputParameter)} does not support writing '{options.Format}' format."); - } - } - - RunCommandInputParameter 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 DeserializeRunCommandInputParameter(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(RunCommandInputParameter)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandManagedIdentity.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandManagedIdentity.cs deleted file mode 100644 index 4bb36250f9c60..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandManagedIdentity.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.HybridCompute.Models -{ - /// Contains clientId or objectId (use only one, not both) of a user-assigned managed identity that has access to storage blob used in Run Command. Use an empty RunCommandManagedIdentity object in case of system-assigned identity. Make sure the Azure storage blob exists in case of scriptUri, and managed identity has been given access to blob's container with 'Storage Blob Data Reader' role assignment with scriptUri blob and 'Storage Blob Data Contributor' for Append blobs(outputBlobUri, errorBlobUri). In case of user assigned identity, make sure you add it under VM's identity. For more info on managed identity and Run Command, refer https://aka.ms/ManagedIdentity and https://aka.ms/RunCommandManaged. - public partial class RunCommandManagedIdentity - { - /// - /// 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 RunCommandManagedIdentity() - { - } - - /// Initializes a new instance of . - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - /// Keeps track of any properties unknown to the library. - internal RunCommandManagedIdentity(Guid? clientId, Guid? objectId, IDictionary serializedAdditionalRawData) - { - ClientId = clientId; - ObjectId = objectId; - _serializedAdditionalRawData = serializedAdditionalRawData; - } - - /// Client Id (GUID value) of the user-assigned managed identity. ObjectId should not be used if this is provided. - [WirePath("clientId")] - public Guid? ClientId { get; set; } - /// Object Id (GUID value) of the user-assigned managed identity. ClientId should not be used if this is provided. - [WirePath("objectId")] - public Guid? ObjectId { get; set; } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs index cf2f12cba90ca..ec2d7cd47818e 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get(strin /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -184,7 +184,7 @@ public virtual AsyncPageable GetA /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -214,7 +214,7 @@ public virtual Pageable GetAll(Ca /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -257,7 +257,7 @@ public virtual async Task> ExistsAsync(string perimeterName, Canc /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -300,7 +300,7 @@ public virtual Response Exists(string perimeterName, CancellationToken can /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -345,7 +345,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs index a5531384c3cef..3d6644b168c72 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs @@ -11,6 +11,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager.HybridCompute.Models; namespace Azure.ResourceManager.HybridCompute { @@ -101,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -141,7 +142,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-05-20-preview + /// 2024-07-10 /// /// /// Resource @@ -167,5 +168,89 @@ public virtual Response Get(Cance throw; } } + + /// + /// Forces the network security perimeter configuration to refresh for a private link scope. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/networkSecurityPerimeterConfigurations/{perimeterName}/reconcile + /// + /// + /// Operation Id + /// NetworkSecurityPerimeterConfigurations_ReconcileForPrivateLinkScope + /// + /// + /// Default Api Version + /// 2024-07-10 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task> ReconcileForPrivateLinkScopeAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationResource.ReconcileForPrivateLinkScope"); + scope.Start(); + try + { + var response = await _networkSecurityPerimeterConfigurationRestClient.ReconcileForPrivateLinkScopeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new HybridComputeArmOperation(new NetworkSecurityPerimeterConfigurationReconcileResultOperationSource(), _networkSecurityPerimeterConfigurationClientDiagnostics, Pipeline, _networkSecurityPerimeterConfigurationRestClient.CreateReconcileForPrivateLinkScopeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Forces the network security perimeter configuration to refresh for a private link scope. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/privateLinkScopes/{scopeName}/networkSecurityPerimeterConfigurations/{perimeterName}/reconcile + /// + /// + /// Operation Id + /// NetworkSecurityPerimeterConfigurations_ReconcileForPrivateLinkScope + /// + /// + /// Default Api Version + /// 2024-07-10 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation ReconcileForPrivateLinkScope(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _networkSecurityPerimeterConfigurationClientDiagnostics.CreateScope("NetworkSecurityPerimeterConfigurationResource.ReconcileForPrivateLinkScope"); + scope.Start(); + try + { + var response = _networkSecurityPerimeterConfigurationRestClient.ReconcileForPrivateLinkScope(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new HybridComputeArmOperation(new NetworkSecurityPerimeterConfigurationReconcileResultOperationSource(), _networkSecurityPerimeterConfigurationClientDiagnostics, Pipeline, _networkSecurityPerimeterConfigurationRestClient.CreateReconcileForPrivateLinkScopeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/ExtensionMetadataRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/ExtensionMetadataRestOperations.cs index 535763209d97f..76e027678e6f2 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/ExtensionMetadataRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/ExtensionMetadataRestOperations.cs @@ -32,7 +32,7 @@ public ExtensionMetadataRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-20-preview"; + _apiVersion = apiVersion ?? "2024-07-10"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/GatewaysRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/GatewaysRestOperations.cs deleted file mode 100644 index 4d34765a6e06a..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/GatewaysRestOperations.cs +++ /dev/null @@ -1,731 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.HybridCompute.Models; - -namespace Azure.ResourceManager.HybridCompute -{ - internal partial class GatewaysRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of GatewaysRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public GatewaysRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-20-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string gatewayName, HybridComputeGatewayData data) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.HybridCompute/gateways/", false); - uri.AppendPath(gatewayName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string gatewayName, HybridComputeGatewayData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.HybridCompute/gateways/", false); - uri.AppendPath(gatewayName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// The operation to create or update a gateway. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the Gateway. - /// Parameters supplied to the Create gateway operation. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string gatewayName, HybridComputeGatewayData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, gatewayName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// The operation to create or update a gateway. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the Gateway. - /// Parameters supplied to the Create gateway operation. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string gatewayName, HybridComputeGatewayData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, gatewayName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string gatewayName, HybridComputeGatewayPatch patch) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.HybridCompute/gateways/", false); - uri.AppendPath(gatewayName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string gatewayName, HybridComputeGatewayPatch patch) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.HybridCompute/gateways/", false); - uri.AppendPath(gatewayName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// The operation to update a gateway. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the Gateway. - /// Parameters supplied to the Update gateway operation. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string gatewayName, HybridComputeGatewayPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, gatewayName, patch); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HybridComputeGatewayData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = HybridComputeGatewayData.DeserializeHybridComputeGatewayData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// The operation to update a gateway. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the Gateway. - /// Parameters supplied to the Update gateway operation. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string gatewayName, HybridComputeGatewayPatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, gatewayName, patch); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HybridComputeGatewayData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = HybridComputeGatewayData.DeserializeHybridComputeGatewayData(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string gatewayName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.HybridCompute/gateways/", false); - uri.AppendPath(gatewayName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string gatewayName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.HybridCompute/gateways/", false); - uri.AppendPath(gatewayName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Retrieves information about the view of a gateway. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the Gateway. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string gatewayName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, gatewayName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - HybridComputeGatewayData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = HybridComputeGatewayData.DeserializeHybridComputeGatewayData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((HybridComputeGatewayData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Retrieves information about the view of a gateway. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the Gateway. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string gatewayName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); - - using var message = CreateGetRequest(subscriptionId, resourceGroupName, gatewayName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - HybridComputeGatewayData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = HybridComputeGatewayData.DeserializeHybridComputeGatewayData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((HybridComputeGatewayData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string gatewayName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.HybridCompute/gateways/", false); - uri.AppendPath(gatewayName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string gatewayName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.HybridCompute/gateways/", false); - uri.AppendPath(gatewayName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// The operation to delete a gateway. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the Gateway. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string gatewayName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, gatewayName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// The operation to delete a gateway. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the Gateway. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string gatewayName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, gatewayName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByResourceGroupRequestUri(string subscriptionId, string resourceGroupName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.HybridCompute/gateways", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.HybridCompute/gateways", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// The operation to get all gateways of a non-Azure machine. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - GatewaysListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = GatewaysListResult.DeserializeGatewaysListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// The operation to get all gateways of a non-Azure machine. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - GatewaysListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = GatewaysListResult.DeserializeGatewaysListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.HybridCompute/gateways", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.HybridCompute/gateways", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// The operation to get all gateways of a non-Azure machine. - /// The ID of the target subscription. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionRequest(subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - GatewaysListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = GatewaysListResult.DeserializeGatewaysListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// The operation to get all gateways of a non-Azure machine. - /// The ID of the target subscription. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionRequest(subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - GatewaysListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = GatewaysListResult.DeserializeGatewaysListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// The operation to get all gateways of a non-Azure machine. - /// The URL to the next page of results. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - GatewaysListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = GatewaysListResult.DeserializeGatewaysListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// The operation to get all gateways of a non-Azure machine. - /// The URL to the next page of results. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - GatewaysListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = GatewaysListResult.DeserializeGatewaysListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - return uri; - } - - internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// The operation to get all gateways of a non-Azure machine. - /// The URL to the next page of results. - /// The ID of the target subscription. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - GatewaysListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = GatewaysListResult.DeserializeGatewaysListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// The operation to get all gateways of a non-Azure machine. - /// The URL to the next page of results. - /// The ID of the target subscription. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - GatewaysListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = GatewaysListResult.DeserializeGatewaysListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/HybridComputeManagementRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/HybridComputeManagementRestOperations.cs index 6bbbeb1f28980..9ed9e5f0dcd3c 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/HybridComputeManagementRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/HybridComputeManagementRestOperations.cs @@ -31,7 +31,7 @@ public HybridComputeManagementRestOperations(HttpPipeline pipeline, string appli { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-20-preview"; + _apiVersion = apiVersion ?? "2024-07-10"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/MachineRunCommandsRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/LicenseProfilesRestOperations.cs similarity index 64% rename from sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/MachineRunCommandsRestOperations.cs rename to sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/LicenseProfilesRestOperations.cs index 6c4b4699cbafa..3765a535537e5 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/MachineRunCommandsRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/LicenseProfilesRestOperations.cs @@ -15,28 +15,28 @@ namespace Azure.ResourceManager.HybridCompute { - internal partial class MachineRunCommandsRestOperations + internal partial class LicenseProfilesRestOperations { private readonly TelemetryDetails _userAgent; private readonly HttpPipeline _pipeline; private readonly Uri _endpoint; private readonly string _apiVersion; - /// Initializes a new instance of MachineRunCommandsRestOperations. + /// Initializes a new instance of LicenseProfilesRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. /// server parameter. /// Api Version. /// or is null. - public MachineRunCommandsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + public LicenseProfilesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-20-preview"; + _apiVersion = apiVersion ?? "2024-07-10"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string machineName, string runCommandName, MachineRunCommandData data) + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string machineName, LicenseProfileData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -46,13 +46,13 @@ internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.HybridCompute/machines/", false); uri.AppendPath(machineName, true); - uri.AppendPath("/runCommands/", false); - uri.AppendPath(runCommandName, true); + uri.AppendPath("/licenseProfiles/", false); + uri.AppendPath("default", true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string machineName, string runCommandName, MachineRunCommandData data) + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string machineName, LicenseProfileData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -65,8 +65,8 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.HybridCompute/machines/", false); uri.AppendPath(machineName, true); - uri.AppendPath("/runCommands/", false); - uri.AppendPath(runCommandName, true); + uri.AppendPath("/licenseProfiles/", false); + uri.AppendPath("default", true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -78,24 +78,22 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r return message; } - /// The operation to create or update a run command. + /// The operation to create or update a license profile. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the hybrid machine. - /// The name of the run command. - /// Parameters supplied to the Create Run Command. + /// Parameters supplied to the Create or Update license profile operation. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string machineName, string runCommandName, MachineRunCommandData data, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string machineName, LicenseProfileData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); - Argument.AssertNotNullOrEmpty(runCommandName, nameof(runCommandName)); Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, machineName, runCommandName, data); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, machineName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -107,24 +105,22 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } } - /// The operation to create or update a run command. + /// The operation to create or update a license profile. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the hybrid machine. - /// The name of the run command. - /// Parameters supplied to the Create Run Command. + /// Parameters supplied to the Create or Update license profile operation. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string machineName, string runCommandName, MachineRunCommandData data, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string machineName, LicenseProfileData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); - Argument.AssertNotNullOrEmpty(runCommandName, nameof(runCommandName)); Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, machineName, runCommandName, data); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, machineName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -136,7 +132,7 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string machineName, string runCommandName) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string machineName, LicenseProfilePatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -146,17 +142,17 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.HybridCompute/machines/", false); uri.AppendPath(machineName, true); - uri.AppendPath("/runCommands/", false); - uri.AppendPath(runCommandName, true); + uri.AppendPath("/licenseProfiles/", false); + uri.AppendPath("default", true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string machineName, string runCommandName) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string machineName, LicenseProfilePatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -165,72 +161,74 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.HybridCompute/machines/", false); uri.AppendPath(machineName, true); - uri.AppendPath("/runCommands/", false); - uri.AppendPath(runCommandName, true); + uri.AppendPath("/licenseProfiles/", false); + uri.AppendPath("default", true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// The operation to delete a run command. + /// The operation to update a license profile. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the hybrid machine. - /// The name of the run command. + /// Parameters supplied to the Update license profile operation. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string machineName, string runCommandName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string machineName, LicenseProfilePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); - Argument.AssertNotNullOrEmpty(runCommandName, nameof(runCommandName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, machineName, runCommandName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, machineName, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// The operation to delete a run command. + /// The operation to update a license profile. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the hybrid machine. - /// The name of the run command. + /// Parameters supplied to the Update license profile operation. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string machineName, string runCommandName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string machineName, LicenseProfilePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); - Argument.AssertNotNullOrEmpty(runCommandName, nameof(runCommandName)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, machineName, runCommandName); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, machineName, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string machineName, string runCommandName) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string machineName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -240,13 +238,13 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.HybridCompute/machines/", false); uri.AppendPath(machineName, true); - uri.AppendPath("/runCommands/", false); - uri.AppendPath(runCommandName, true); + uri.AppendPath("/licenseProfiles/", false); + uri.AppendPath("default", true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string machineName, string runCommandName) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string machineName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -259,8 +257,8 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.HybridCompute/machines/", false); uri.AppendPath(machineName, true); - uri.AppendPath("/runCommands/", false); - uri.AppendPath(runCommandName, true); + uri.AppendPath("/licenseProfiles/", false); + uri.AppendPath("default", true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -268,73 +266,69 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou return message; } - /// The operation to get a run command. + /// Retrieves information about the view of a license profile. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the hybrid machine. - /// The name of the run command. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string machineName, string runCommandName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string machineName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); - Argument.AssertNotNullOrEmpty(runCommandName, nameof(runCommandName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, machineName, runCommandName); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, machineName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - MachineRunCommandData value = default; + LicenseProfileData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = MachineRunCommandData.DeserializeMachineRunCommandData(document.RootElement); + value = LicenseProfileData.DeserializeLicenseProfileData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((MachineRunCommandData)null, message.Response); + return Response.FromValue((LicenseProfileData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// The operation to get a run command. + /// Retrieves information about the view of a license profile. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the hybrid machine. - /// The name of the run command. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string machineName, string runCommandName, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string machineName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); - Argument.AssertNotNullOrEmpty(runCommandName, nameof(runCommandName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, machineName, runCommandName); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, machineName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - MachineRunCommandData value = default; + LicenseProfileData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = MachineRunCommandData.DeserializeMachineRunCommandData(document.RootElement); + value = LicenseProfileData.DeserializeLicenseProfileData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((MachineRunCommandData)null, message.Response); + return Response.FromValue((LicenseProfileData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string machineName, string expand) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string machineName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -344,16 +338,100 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.HybridCompute/machines/", false); uri.AppendPath(machineName, true); - uri.AppendPath("/runCommands", false); - if (expand != null) + uri.AppendPath("/licenseProfiles/", false); + uri.AppendPath("default", true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string machineName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.HybridCompute/machines/", false); + uri.AppendPath(machineName, true); + uri.AppendPath("/licenseProfiles/", false); + uri.AppendPath("default", true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// The operation to delete a license profile. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the hybrid machine. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string machineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, machineName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) { - uri.AppendQuery("$expand", expand, true); + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); } + } + + /// The operation to delete a license profile. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the hybrid machine. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string machineName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, machineName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string machineName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.HybridCompute/machines/", false); + uri.AppendPath(machineName, true); + uri.AppendPath("/licenseProfiles", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string machineName, string expand) + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string machineName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -366,11 +444,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.HybridCompute/machines/", false); uri.AppendPath(machineName, true); - uri.AppendPath("/runCommands", false); - if (expand != null) - { - uri.AppendQuery("$expand", expand, true); - } + uri.AppendPath("/licenseProfiles", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -378,29 +452,28 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro return message; } - /// The operation to get all the run commands of a non-Azure machine. + /// The operation to get all license profiles of a non-Azure machine. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. - /// The expand expression to apply on the operation. + /// The name of the machine. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string machineName, string expand = null, CancellationToken cancellationToken = default) + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string machineName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, machineName, expand); + using var message = CreateListRequest(subscriptionId, resourceGroupName, machineName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - MachineRunCommandsListResult value = default; + LicenseProfilesListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = MachineRunCommandsListResult.DeserializeMachineRunCommandsListResult(document.RootElement); + value = LicenseProfilesListResult.DeserializeLicenseProfilesListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -408,29 +481,28 @@ public async Task> ListAsync(string subsc } } - /// The operation to get all the run commands of a non-Azure machine. + /// The operation to get all license profiles of a non-Azure machine. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. - /// The expand expression to apply on the operation. + /// The name of the machine. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string machineName, string expand = null, CancellationToken cancellationToken = default) + public Response List(string subscriptionId, string resourceGroupName, string machineName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, machineName, expand); + using var message = CreateListRequest(subscriptionId, resourceGroupName, machineName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - MachineRunCommandsListResult value = default; + LicenseProfilesListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = MachineRunCommandsListResult.DeserializeMachineRunCommandsListResult(document.RootElement); + value = LicenseProfilesListResult.DeserializeLicenseProfilesListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -438,7 +510,7 @@ public Response List(string subscriptionId, string } } - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string machineName, string expand) + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string machineName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -446,7 +518,7 @@ internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string return uri; } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string machineName, string expand) + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string machineName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -460,31 +532,30 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript return message; } - /// The operation to get all the run commands of a non-Azure machine. + /// The operation to get all license profiles of a non-Azure machine. /// The URL to the next page of results. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. - /// The expand expression to apply on the operation. + /// The name of the machine. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string machineName, string expand = null, CancellationToken cancellationToken = default) + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string machineName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, machineName, expand); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, machineName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - MachineRunCommandsListResult value = default; + LicenseProfilesListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = MachineRunCommandsListResult.DeserializeMachineRunCommandsListResult(document.RootElement); + value = LicenseProfilesListResult.DeserializeLicenseProfilesListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -492,31 +563,30 @@ public async Task> ListNextPageAsync(stri } } - /// The operation to get all the run commands of a non-Azure machine. + /// The operation to get all license profiles of a non-Azure machine. /// The URL to the next page of results. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. - /// The name of the hybrid machine. - /// The expand expression to apply on the operation. + /// The name of the machine. /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string machineName, string expand = null, CancellationToken cancellationToken = default) + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string machineName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, machineName, expand); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, machineName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - MachineRunCommandsListResult value = default; + LicenseProfilesListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = MachineRunCommandsListResult.DeserializeMachineRunCommandsListResult(document.RootElement); + value = LicenseProfilesListResult.DeserializeLicenseProfilesListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/LicensesRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/LicensesRestOperations.cs index 174bfb4dad683..517a1e17f9df1 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/LicensesRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/LicensesRestOperations.cs @@ -32,10 +32,86 @@ public LicensesRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-20-preview"; + _apiVersion = apiVersion ?? "2024-07-10"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } + internal RequestUriBuilder CreateValidateLicenseRequestUri(string subscriptionId, HybridComputeLicenseData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.HybridCompute/validateLicense", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateValidateLicenseRequest(string subscriptionId, HybridComputeLicenseData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.HybridCompute/validateLicense", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// The operation to validate a license. + /// The ID of the target subscription. + /// Parameters supplied to the license validation operation. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task ValidateLicenseAsync(string subscriptionId, HybridComputeLicenseData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateValidateLicenseRequest(subscriptionId, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// The operation to validate a license. + /// The ID of the target subscription. + /// Parameters supplied to the license validation operation. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ValidateLicense(string subscriptionId, HybridComputeLicenseData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateValidateLicenseRequest(subscriptionId, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string licenseName, HybridComputeLicenseData data) { var uri = new RawRequestUriBuilder(); diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/MachineExtensionsRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/MachineExtensionsRestOperations.cs index 859dc15f190b8..a21c68e80b016 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/MachineExtensionsRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/MachineExtensionsRestOperations.cs @@ -32,7 +32,7 @@ public MachineExtensionsRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-20-preview"; + _apiVersion = apiVersion ?? "2024-07-10"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -178,7 +178,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG return message; } - /// The operation to create or update the extension. + /// The operation to update the extension. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the machine where the extension should be created or updated. @@ -207,7 +207,7 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr } } - /// The operation to create or update the extension. + /// The operation to update the extension. /// The ID of the target subscription. /// The name of the resource group. The name is case insensitive. /// The name of the machine where the extension should be created or updated. diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/MachinesRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/MachinesRestOperations.cs index 41bc2768795c3..096dbaca21ca0 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/MachinesRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/MachinesRestOperations.cs @@ -32,10 +32,120 @@ public MachinesRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-20-preview"; + _apiVersion = apiVersion ?? "2024-07-10"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string machineName, HybridComputeMachineData data, string expand) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.HybridCompute/machines/", false); + uri.AppendPath(machineName, true); + uri.AppendQuery("api-version", _apiVersion, true); + if (expand != null) + { + uri.AppendQuery("$expand", expand, true); + } + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string machineName, HybridComputeMachineData data, string expand) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.HybridCompute/machines/", false); + uri.AppendPath(machineName, true); + uri.AppendQuery("api-version", _apiVersion, true); + if (expand != null) + { + uri.AppendQuery("$expand", expand, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// The operation to create or update a hybrid machine. Please note some properties can be set only during machine creation. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the hybrid machine. + /// Parameters supplied to the Create hybrid machine operation. + /// Expands referenced resources. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string machineName, HybridComputeMachineData data, string expand = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, machineName, data, expand); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + HybridComputeMachineData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = HybridComputeMachineData.DeserializeHybridComputeMachineData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// The operation to create or update a hybrid machine. Please note some properties can be set only during machine creation. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the hybrid machine. + /// Parameters supplied to the Create hybrid machine operation. + /// Expands referenced resources. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string machineName, HybridComputeMachineData data, string expand = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(machineName, nameof(machineName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, machineName, data, expand); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + HybridComputeMachineData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = HybridComputeMachineData.DeserializeHybridComputeMachineData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string machineName, HybridComputeMachinePatch patch) { var uri = new RawRequestUriBuilder(); diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/NetworkProfileRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/NetworkProfileRestOperations.cs index 3ea8898f3dd0d..3de41308a598b 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/NetworkProfileRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/NetworkProfileRestOperations.cs @@ -32,7 +32,7 @@ public NetworkProfileRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-20-preview"; + _apiVersion = apiVersion ?? "2024-07-10"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationsRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationsRestOperations.cs index a7759fbf7d493..dbd45b9fb0aa5 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationsRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/NetworkSecurityPerimeterConfigurationsRestOperations.cs @@ -32,7 +32,7 @@ public NetworkSecurityPerimeterConfigurationsRestOperations(HttpPipeline pipelin { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-20-preview"; + _apiVersion = apiVersion ?? "2024-07-10"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -234,6 +234,100 @@ public Response ListByPrivateLi } } + internal RequestUriBuilder CreateReconcileForPrivateLinkScopeRequestUri(string subscriptionId, string resourceGroupName, string scopeName, string perimeterName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.HybridCompute/privateLinkScopes/", false); + uri.AppendPath(scopeName, true); + uri.AppendPath("/networkSecurityPerimeterConfigurations/", false); + uri.AppendPath(perimeterName, true); + uri.AppendPath("/reconcile", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateReconcileForPrivateLinkScopeRequest(string subscriptionId, string resourceGroupName, string scopeName, string perimeterName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.HybridCompute/privateLinkScopes/", false); + uri.AppendPath(scopeName, true); + uri.AppendPath("/networkSecurityPerimeterConfigurations/", false); + uri.AppendPath(perimeterName, true); + uri.AppendPath("/reconcile", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Forces the network security perimeter configuration to refresh for a private link scope. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Azure Arc PrivateLinkScope resource. + /// The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task ReconcileForPrivateLinkScopeAsync(string subscriptionId, string resourceGroupName, string scopeName, string perimeterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(scopeName, nameof(scopeName)); + Argument.AssertNotNullOrEmpty(perimeterName, nameof(perimeterName)); + + using var message = CreateReconcileForPrivateLinkScopeRequest(subscriptionId, resourceGroupName, scopeName, perimeterName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Forces the network security perimeter configuration to refresh for a private link scope. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the Azure Arc PrivateLinkScope resource. + /// The name, in the format {perimeterGuid}.{associationName}, of the Network Security Perimeter resource. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ReconcileForPrivateLinkScope(string subscriptionId, string resourceGroupName, string scopeName, string perimeterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(scopeName, nameof(scopeName)); + Argument.AssertNotNullOrEmpty(perimeterName, nameof(perimeterName)); + + using var message = CreateReconcileForPrivateLinkScopeRequest(subscriptionId, resourceGroupName, scopeName, perimeterName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + internal RequestUriBuilder CreateListByPrivateLinkScopeNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string scopeName) { var uri = new RawRequestUriBuilder(); diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs index 0fc03a5eb35fb..1aea81b239d5c 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs @@ -32,7 +32,7 @@ public PrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-20-preview"; + _apiVersion = apiVersion ?? "2024-07-10"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs index 54c36e60cd944..0e66a472dbe09 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs @@ -32,7 +32,7 @@ public PrivateLinkResourcesRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-20-preview"; + _apiVersion = apiVersion ?? "2024-07-10"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateLinkScopesRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateLinkScopesRestOperations.cs index 157e2039387bd..1be5d5f18c881 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateLinkScopesRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/PrivateLinkScopesRestOperations.cs @@ -32,7 +32,7 @@ public PrivateLinkScopesRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-20-preview"; + _apiVersion = apiVersion ?? "2024-07-10"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/SettingsRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/SettingsRestOperations.cs deleted file mode 100644 index 705e6da3d6914..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/SettingsRestOperations.cs +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.HybridCompute.Models; - -namespace Azure.ResourceManager.HybridCompute -{ - internal partial class SettingsRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of SettingsRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public SettingsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-05-20-preview"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, HybridComputeTargetResourceSettings hybridComputeTargetResourceSettings) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/", false); - uri.AppendPath(baseProvider, true); - uri.AppendPath("/", false); - uri.AppendPath(baseResourceType, true); - uri.AppendPath("/", false); - uri.AppendPath(baseResourceName, true); - uri.AppendPath("/providers/Microsoft.HybridCompute/settings/", false); - uri.AppendPath(settingsResourceName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, HybridComputeTargetResourceSettings hybridComputeTargetResourceSettings) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/", false); - uri.AppendPath(baseProvider, true); - uri.AppendPath("/", false); - uri.AppendPath(baseResourceType, true); - uri.AppendPath("/", false); - uri.AppendPath(baseResourceName, true); - uri.AppendPath("/providers/Microsoft.HybridCompute/settings/", false); - uri.AppendPath(settingsResourceName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(hybridComputeTargetResourceSettings, ModelSerializationExtensions.WireOptions); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Updates the base Settings of the target resource. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the base Resource Provider. - /// The name of the base Resource Type. - /// The name of the base resource. - /// The name of the settings resource. - /// Settings details. - /// The cancellation token to use. - /// , , , , , or is null. - /// , , , , or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, HybridComputeTargetResourceSettings hybridComputeTargetResourceSettings, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(baseProvider, nameof(baseProvider)); - Argument.AssertNotNullOrEmpty(baseResourceType, nameof(baseResourceType)); - Argument.AssertNotNullOrEmpty(baseResourceName, nameof(baseResourceName)); - Argument.AssertNotNullOrEmpty(settingsResourceName, nameof(settingsResourceName)); - Argument.AssertNotNull(hybridComputeTargetResourceSettings, nameof(hybridComputeTargetResourceSettings)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, baseProvider, baseResourceType, baseResourceName, settingsResourceName, hybridComputeTargetResourceSettings); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 201: - { - HybridComputeTargetResourceSettings value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = HybridComputeTargetResourceSettings.DeserializeHybridComputeTargetResourceSettings(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Updates the base Settings of the target resource. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the base Resource Provider. - /// The name of the base Resource Type. - /// The name of the base resource. - /// The name of the settings resource. - /// Settings details. - /// The cancellation token to use. - /// , , , , , or is null. - /// , , , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, HybridComputeTargetResourceSettings hybridComputeTargetResourceSettings, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(baseProvider, nameof(baseProvider)); - Argument.AssertNotNullOrEmpty(baseResourceType, nameof(baseResourceType)); - Argument.AssertNotNullOrEmpty(baseResourceName, nameof(baseResourceName)); - Argument.AssertNotNullOrEmpty(settingsResourceName, nameof(settingsResourceName)); - Argument.AssertNotNull(hybridComputeTargetResourceSettings, nameof(hybridComputeTargetResourceSettings)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, baseProvider, baseResourceType, baseResourceName, settingsResourceName, hybridComputeTargetResourceSettings); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 201: - { - HybridComputeTargetResourceSettings value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = HybridComputeTargetResourceSettings.DeserializeHybridComputeTargetResourceSettings(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md index 263dc5ff91103..49c2043691c63 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md @@ -8,8 +8,8 @@ azure-arm: true csharp: true library-name: HybridCompute namespace: Azure.ResourceManager.HybridCompute -require: https://github.com/Azure/azure-rest-api-specs/blob/b48d5d72073a296514d3d4db77887d8711526ccc/specification/hybridcompute/resource-manager/readme.md -#tag: package-preview-2024-05 +require: https://github.com/Azure/azure-rest-api-specs/blob/15b16d1b5c3cccdecdd1cfe936f6a8005680c557/specification/hybridcompute/resource-manager/readme.md +tag: package-2024-07 output-folder: $(this-folder)/Generated clear-output-folder: true sample-gen: @@ -219,45 +219,45 @@ directive: } ] - # add 200 response to run-command delete - - from: HybridCompute.json - where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}"].delete.responses - transform: >- - return { - "200": { - "description": "OK" - }, - "202": { - "description": "Accepted", - "headers": { - "Location": { - "description": "The URL of the resource used to check the status of the asynchronous operation.", - "type": "string" - }, - "Retry-After": { - "description": "The recommended number of seconds to wait before calling the URI specified in Azure-AsyncOperation.", - "type": "integer", - "format": "int32" - }, - "Azure-AsyncOperation": { - "description": "The URI to poll for completion status.", - "type": "string" - } - } - }, - "204": { - "description": "No Content" - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "https://github.com/Azure/azure-rest-api-specs/blob/f6278b35fb38d62aadb7a4327a876544d5d7e1e4/specification/common-types/resource-management/v3/types.json#/definitions/ErrorResponse" - } - } - } + # add 200 response to run-command delete - comment out for stable release + # - from: HybridCompute.json + # where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute/machines/{machineName}/runCommands/{runCommandName}"].delete.responses + # transform: >- + # return { + # "200": { + # "description": "OK" + # }, + # "202": { + # "description": "Accepted", + # "headers": { + # "Location": { + # "description": "The URL of the resource used to check the status of the asynchronous operation.", + # "type": "string" + # }, + # "Retry-After": { + # "description": "The recommended number of seconds to wait before calling the URI specified in Azure-AsyncOperation.", + # "type": "integer", + # "format": "int32" + # }, + # "Azure-AsyncOperation": { + # "description": "The URI to poll for completion status.", + # "type": "string" + # } + # } + # }, + # "204": { + # "description": "No Content" + # }, + # "default": { + # "description": "Error response describing why the operation failed.", + # "schema": { + # "$ref": "https://github.com/Azure/azure-rest-api-specs/blob/f6278b35fb38d62aadb7a4327a876544d5d7e1e4/specification/common-types/resource-management/v3/types.json#/definitions/ErrorResponse" + # } + # } + # } - # we don't want user to interact with them / we don't support some operations - - remove-operation: MachineRunCommands_Update #PATCH + # we don't want user to interact with them / we don't support some operations - comment out for stable release + # - remove-operation: MachineRunCommands_Update #PATCH # internal operations - remove-operation: AgentVersion_List - remove-operation: AgentVersion_Get diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/HybridComputeManagementTestBase.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/HybridComputeManagementTestBase.cs index b067debcef1e7..fbdafe8f910da 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/HybridComputeManagementTestBase.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/HybridComputeManagementTestBase.cs @@ -25,9 +25,9 @@ public class HybridComputeManagementTestBase : ManagementRecordedTestBase Date: Sun, 13 Oct 2024 22:04:11 -0400 Subject: [PATCH 02/14] update code --- ...rceManager.HybridCompute.netstandard2.0.cs | 388 +++++------------- .../tests/HybridComputeManagementTestBase.cs | 200 ++++----- .../HybridComputeManagementNspTest.cs | 7 + 3 files changed, 224 insertions(+), 371 deletions(-) diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/api/Azure.ResourceManager.HybridCompute.netstandard2.0.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/api/Azure.ResourceManager.HybridCompute.netstandard2.0.cs index f5bf61451110e..c86a3573af7a3 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/api/Azure.ResourceManager.HybridCompute.netstandard2.0.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/api/Azure.ResourceManager.HybridCompute.netstandard2.0.cs @@ -6,12 +6,6 @@ public static partial class HybridComputeExtensions public static System.Threading.Tasks.Task> GetHybridComputeExtensionValueAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, string publisher, string extensionType, string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.HybridCompute.HybridComputeExtensionValueResource GetHybridComputeExtensionValueResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.HybridCompute.HybridComputeExtensionValueCollection GetHybridComputeExtensionValues(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, string publisher, string extensionType) { throw null; } - public static Azure.Response GetHybridComputeGateway(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static System.Threading.Tasks.Task> GetHybridComputeGatewayAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.ResourceManager.HybridCompute.HybridComputeGatewayResource GetHybridComputeGatewayResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - public static Azure.ResourceManager.HybridCompute.HybridComputeGatewayCollection GetHybridComputeGateways(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } - public static Azure.Pageable GetHybridComputeGateways(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.AsyncPageable GetHybridComputeGatewaysAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Response GetHybridComputeLicense(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string licenseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetHybridComputeLicenseAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string licenseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.HybridCompute.HybridComputeLicenseResource GetHybridComputeLicenseResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } @@ -33,12 +27,12 @@ public static partial class HybridComputeExtensions public static Azure.ResourceManager.HybridCompute.HybridComputePrivateLinkScopeCollection GetHybridComputePrivateLinkScopes(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetHybridComputePrivateLinkScopes(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetHybridComputePrivateLinkScopesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.ResourceManager.HybridCompute.MachineRunCommandResource GetMachineRunCommandResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.HybridCompute.LicenseProfileResource GetLicenseProfileResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.HybridCompute.NetworkSecurityPerimeterConfigurationResource GetNetworkSecurityPerimeterConfigurationResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Response GetValidationDetailsPrivateLinkScope(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, string privateLinkScopeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetValidationDetailsPrivateLinkScopeAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, string privateLinkScopeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.Response UpdateTargetResourceSetting(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, Azure.ResourceManager.HybridCompute.Models.HybridComputeTargetResourceSettings hybridComputeTargetResourceSettings, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static System.Threading.Tasks.Task> UpdateTargetResourceSettingAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, Azure.ResourceManager.HybridCompute.Models.HybridComputeTargetResourceSettings hybridComputeTargetResourceSettings, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.ArmOperation ValidateLicenseLicense(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridCompute.HybridComputeLicenseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> ValidateLicenseLicenseAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridCompute.HybridComputeLicenseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class HybridComputeExtensionValueCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -57,7 +51,7 @@ protected HybridComputeExtensionValueCollection() { } } public partial class HybridComputeExtensionValueData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public HybridComputeExtensionValueData() { } + internal HybridComputeExtensionValueData() { } public string ExtensionType { get { throw null; } } public string Publisher { get { throw null; } } public string Version { get { throw null; } } @@ -83,63 +77,6 @@ protected HybridComputeExtensionValueResource() { } string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class HybridComputeGatewayCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - protected HybridComputeGatewayCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string gatewayName, Azure.ResourceManager.HybridCompute.HybridComputeGatewayData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string gatewayName, Azure.ResourceManager.HybridCompute.HybridComputeGatewayData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Exists(string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ExistsAsync(string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.NullableResponse GetIfExists(string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } - System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - } - public partial class HybridComputeGatewayData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public HybridComputeGatewayData(Azure.Core.AzureLocation location) { } - public System.Collections.Generic.IList AllowedFeatures { get { throw null; } } - public string GatewayEndpoint { get { throw null; } } - public string GatewayId { get { throw null; } } - public Azure.ResourceManager.HybridCompute.Models.HybridComputeGatewayType? GatewayType { get { throw null; } set { } } - public Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningState? ProvisioningState { get { throw null; } } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.HybridCompute.HybridComputeGatewayData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.HybridCompute.HybridComputeGatewayData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class HybridComputeGatewayResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public static readonly Azure.Core.ResourceType ResourceType; - protected HybridComputeGatewayResource() { } - public virtual Azure.ResourceManager.HybridCompute.HybridComputeGatewayData Data { get { throw null; } } - public virtual bool HasData { get { throw null; } } - public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string gatewayName) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - Azure.ResourceManager.HybridCompute.HybridComputeGatewayData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.HybridCompute.HybridComputeGatewayData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.Response Update(Azure.ResourceManager.HybridCompute.Models.HybridComputeGatewayPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.HybridCompute.Models.HybridComputeGatewayPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - } public partial class HybridComputeLicenseCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected HybridComputeLicenseCollection() { } @@ -199,6 +136,8 @@ protected HybridComputeLicenseResource() { } public partial class HybridComputeMachineCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected HybridComputeMachineCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string machineName, Azure.ResourceManager.HybridCompute.HybridComputeMachineData data, string expand = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string machineName, Azure.ResourceManager.HybridCompute.HybridComputeMachineData data, string expand = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Exists(string machineName, string expand = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> ExistsAsync(string machineName, string expand = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(string machineName, string expand = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -326,9 +265,7 @@ protected HybridComputeMachineResource() { } public virtual Azure.Response GetHybridComputeMachineExtension(string extensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetHybridComputeMachineExtensionAsync(string extensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.HybridCompute.HybridComputeMachineExtensionCollection GetHybridComputeMachineExtensions() { throw null; } - public virtual Azure.Response GetMachineRunCommand(string runCommandName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetMachineRunCommandAsync(string runCommandName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.HybridCompute.MachineRunCommandCollection GetMachineRunCommands() { throw null; } + public virtual Azure.ResourceManager.HybridCompute.LicenseProfileResource GetLicenseProfile() { throw null; } public virtual Azure.Response GetNetworkProfile(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetNetworkProfileAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetValidationDetailsForMachinePrivateLinkScope(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -499,70 +436,58 @@ protected HybridComputePrivateLinkScopeResource() { } public virtual Azure.Response Update(Azure.ResourceManager.HybridCompute.Models.HybridComputePrivateLinkScopePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.HybridCompute.Models.HybridComputePrivateLinkScopePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } - public partial class MachineRunCommandCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - protected MachineRunCommandCollection() { } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string runCommandName, Azure.ResourceManager.HybridCompute.MachineRunCommandData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string runCommandName, Azure.ResourceManager.HybridCompute.MachineRunCommandData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Exists(string runCommandName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ExistsAsync(string runCommandName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string runCommandName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(string expand = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(string expand = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string runCommandName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.NullableResponse GetIfExists(string runCommandName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string runCommandName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } - System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - } - public partial class MachineRunCommandData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public MachineRunCommandData(Azure.Core.AzureLocation location) { } - public bool? AsyncExecution { get { throw null; } set { } } - public Azure.ResourceManager.HybridCompute.Models.RunCommandManagedIdentity ErrorBlobManagedIdentity { get { throw null; } set { } } - public System.Uri ErrorBlobUri { get { throw null; } set { } } - public Azure.ResourceManager.HybridCompute.Models.MachineRunCommandInstanceView InstanceView { get { throw null; } } - public Azure.ResourceManager.HybridCompute.Models.RunCommandManagedIdentity OutputBlobManagedIdentity { get { throw null; } set { } } - public System.Uri OutputBlobUri { get { throw null; } set { } } - public System.Collections.Generic.IList Parameters { get { throw null; } } - public System.Collections.Generic.IList ProtectedParameters { get { throw null; } } - public string ProvisioningState { get { throw null; } } - public string RunAsPassword { get { throw null; } set { } } - public string RunAsUser { get { throw null; } set { } } - public Azure.ResourceManager.HybridCompute.Models.MachineRunCommandScriptSource Source { get { throw null; } set { } } - public int? TimeoutInSeconds { get { throw null; } set { } } + public partial class LicenseProfileData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public LicenseProfileData(Azure.Core.AzureLocation location) { } + public string AssignedLicense { get { throw null; } set { } } + public System.Guid? AssignedLicenseImmutableId { get { throw null; } } + public System.DateTimeOffset? BillingEndOn { get { throw null; } } + public System.DateTimeOffset? BillingStartOn { get { throw null; } } + public System.DateTimeOffset? DisenrollmentOn { get { throw null; } } + public System.DateTimeOffset? EnrollmentOn { get { throw null; } } + public Azure.ResponseError Error { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.EsuEligibility? EsuEligibility { get { throw null; } } + public System.Collections.Generic.IReadOnlyList EsuKeys { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.EsuKeyState? EsuKeyState { get { throw null; } } + public System.Collections.Generic.IList ProductFeatures { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.LicenseProfileProductType? ProductType { get { throw null; } set { } } + public Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.EsuServerType? ServerType { get { throw null; } } + public bool? SoftwareAssuranceCustomer { get { throw null; } set { } } + public Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatus? SubscriptionStatus { get { throw null; } set { } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.HybridCompute.MachineRunCommandData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.HybridCompute.MachineRunCommandData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.HybridCompute.LicenseProfileData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.LicenseProfileData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class MachineRunCommandResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class LicenseProfileResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public static readonly Azure.Core.ResourceType ResourceType; - protected MachineRunCommandResource() { } - public virtual Azure.ResourceManager.HybridCompute.MachineRunCommandData Data { get { throw null; } } + protected LicenseProfileResource() { } + public virtual Azure.ResourceManager.HybridCompute.LicenseProfileData Data { get { throw null; } } public virtual bool HasData { get { throw null; } } - public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string machineName, string runCommandName) { throw null; } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridCompute.LicenseProfileData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridCompute.LicenseProfileData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string machineName) { throw null; } public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - Azure.ResourceManager.HybridCompute.MachineRunCommandData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.HybridCompute.MachineRunCommandData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridCompute.MachineRunCommandData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridCompute.MachineRunCommandData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.HybridCompute.LicenseProfileData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.LicenseProfileData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridCompute.Models.LicenseProfilePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridCompute.Models.LicenseProfilePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class NetworkSecurityPerimeterConfigurationCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -603,6 +528,8 @@ protected NetworkSecurityPerimeterConfigurationResource() { } public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string scopeName, string perimeterName) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation ReconcileForPrivateLinkScope(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ReconcileForPrivateLinkScopeAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } Azure.ResourceManager.HybridCompute.NetworkSecurityPerimeterConfigurationData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.HybridCompute.NetworkSecurityPerimeterConfigurationData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -616,22 +543,18 @@ public partial class MockableHybridComputeArmClient : Azure.ResourceManager.ArmR { protected MockableHybridComputeArmClient() { } public virtual Azure.ResourceManager.HybridCompute.HybridComputeExtensionValueResource GetHybridComputeExtensionValueResource(Azure.Core.ResourceIdentifier id) { throw null; } - public virtual Azure.ResourceManager.HybridCompute.HybridComputeGatewayResource GetHybridComputeGatewayResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.HybridCompute.HybridComputeLicenseResource GetHybridComputeLicenseResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.HybridCompute.HybridComputeMachineExtensionResource GetHybridComputeMachineExtensionResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.HybridCompute.HybridComputeMachineResource GetHybridComputeMachineResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.HybridCompute.HybridComputePrivateEndpointConnectionResource GetHybridComputePrivateEndpointConnectionResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.HybridCompute.HybridComputePrivateLinkResource GetHybridComputePrivateLinkResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.HybridCompute.HybridComputePrivateLinkScopeResource GetHybridComputePrivateLinkScopeResource(Azure.Core.ResourceIdentifier id) { throw null; } - public virtual Azure.ResourceManager.HybridCompute.MachineRunCommandResource GetMachineRunCommandResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.HybridCompute.LicenseProfileResource GetLicenseProfileResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.HybridCompute.NetworkSecurityPerimeterConfigurationResource GetNetworkSecurityPerimeterConfigurationResource(Azure.Core.ResourceIdentifier id) { throw null; } } public partial class MockableHybridComputeResourceGroupResource : Azure.ResourceManager.ArmResource { protected MockableHybridComputeResourceGroupResource() { } - public virtual Azure.Response GetHybridComputeGateway(string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetHybridComputeGatewayAsync(string gatewayName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.HybridCompute.HybridComputeGatewayCollection GetHybridComputeGateways() { throw null; } public virtual Azure.Response GetHybridComputeLicense(string licenseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetHybridComputeLicenseAsync(string licenseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.HybridCompute.HybridComputeLicenseCollection GetHybridComputeLicenses() { throw null; } @@ -641,8 +564,6 @@ protected MockableHybridComputeResourceGroupResource() { } public virtual Azure.Response GetHybridComputePrivateLinkScope(string scopeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetHybridComputePrivateLinkScopeAsync(string scopeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.HybridCompute.HybridComputePrivateLinkScopeCollection GetHybridComputePrivateLinkScopes() { throw null; } - public virtual Azure.Response UpdateTargetResourceSetting(string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, Azure.ResourceManager.HybridCompute.Models.HybridComputeTargetResourceSettings hybridComputeTargetResourceSettings, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateTargetResourceSettingAsync(string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, Azure.ResourceManager.HybridCompute.Models.HybridComputeTargetResourceSettings hybridComputeTargetResourceSettings, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class MockableHybridComputeSubscriptionResource : Azure.ResourceManager.ArmResource { @@ -650,8 +571,6 @@ protected MockableHybridComputeSubscriptionResource() { } public virtual Azure.Response GetHybridComputeExtensionValue(Azure.Core.AzureLocation location, string publisher, string extensionType, string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetHybridComputeExtensionValueAsync(Azure.Core.AzureLocation location, string publisher, string extensionType, string version, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.HybridCompute.HybridComputeExtensionValueCollection GetHybridComputeExtensionValues(Azure.Core.AzureLocation location, string publisher, string extensionType) { throw null; } - public virtual Azure.Pageable GetHybridComputeGateways(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetHybridComputeGatewaysAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetHybridComputeLicenses(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetHybridComputeLicensesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Pageable GetHybridComputeMachines(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -660,6 +579,8 @@ protected MockableHybridComputeSubscriptionResource() { } public virtual Azure.AsyncPageable GetHybridComputePrivateLinkScopesAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetValidationDetailsPrivateLinkScope(Azure.Core.AzureLocation location, string privateLinkScopeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetValidationDetailsPrivateLinkScopeAsync(Azure.Core.AzureLocation location, string privateLinkScopeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation ValidateLicenseLicense(Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridCompute.HybridComputeLicenseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ValidateLicenseLicenseAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridCompute.HybridComputeLicenseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.ResourceManager.HybridCompute.Models @@ -746,12 +667,10 @@ public static partial class ArmHybridComputeModelFactory public static Azure.ResourceManager.HybridCompute.Models.AgentUpgrade AgentUpgrade(string desiredVersion = null, System.Guid? correlationId = default(System.Guid?), bool? isAutomaticUpgradeEnabled = default(bool?), string lastAttemptDesiredVersion = null, System.DateTimeOffset? lastAttemptedOn = default(System.DateTimeOffset?), Azure.ResourceManager.HybridCompute.Models.LastAttemptStatusEnum? lastAttemptStatus = default(Azure.ResourceManager.HybridCompute.Models.LastAttemptStatusEnum?), string lastAttemptMessage = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.AvailablePatchCountByClassification AvailablePatchCountByClassification(int? security = default(int?), int? critical = default(int?), int? definition = default(int?), int? updateRollup = default(int?), int? featurePack = default(int?), int? servicePack = default(int?), int? tools = default(int?), int? updates = default(int?), int? other = default(int?)) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.EsuKey EsuKey(string sku = null, int? licenseStatus = default(int?)) { throw null; } - public static Azure.ResourceManager.HybridCompute.Models.ExtensionsResourceStatus ExtensionsResourceStatus(string code = null, Azure.ResourceManager.HybridCompute.Models.ExtensionsStatusLevelType? level = default(Azure.ResourceManager.HybridCompute.Models.ExtensionsStatusLevelType?), string displayStatus = null, string message = null, System.DateTimeOffset? time = default(System.DateTimeOffset?)) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputeAccessRule HybridComputeAccessRule(string name = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeAccessRuleDirection? direction = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeAccessRuleDirection?), System.Collections.Generic.IEnumerable addressPrefixes = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputeConfigurationExtension HybridComputeConfigurationExtension(string publisher = null, string configurationExtensionType = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputeConnectionDetail HybridComputeConnectionDetail(Azure.Core.ResourceIdentifier id = null, string privateIPAddress = null, string linkIdentifier = null, string groupId = null, string memberName = null) { throw null; } public static Azure.ResourceManager.HybridCompute.HybridComputeExtensionValueData HybridComputeExtensionValueData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string version = null, string extensionType = null, string publisher = null) { throw null; } - public static Azure.ResourceManager.HybridCompute.HybridComputeGatewayData HybridComputeGatewayData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningState? provisioningState = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningState?), string gatewayId = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeGatewayType? gatewayType = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeGatewayType?), string gatewayEndpoint = null, System.Collections.Generic.IEnumerable allowedFeatures = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputeIPAddress HybridComputeIPAddress(string address = null, string ipAddressVersion = null, string subnetAddressPrefix = null) { throw null; } public static Azure.ResourceManager.HybridCompute.HybridComputeLicenseData HybridComputeLicenseData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningState? provisioningState = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningState?), System.Guid? tenantId = default(System.Guid?), Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseType? licenseType = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseType?), Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseDetails licenseDetails = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseDetails HybridComputeLicenseDetails(Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseState? state = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseState?), Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseTarget? target = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseTarget?), Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseEdition? edition = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseEdition?), Azure.ResourceManager.HybridCompute.Models.LicenseCoreType? licenseCoreType = default(Azure.ResourceManager.HybridCompute.Models.LicenseCoreType?), int? processors = default(int?), int? assignedLicenses = default(int?), string immutableId = null, System.Collections.Generic.IEnumerable volumeLicenseDetails = null) { throw null; } @@ -772,9 +691,9 @@ public static partial class ArmHybridComputeModelFactory public static Azure.ResourceManager.HybridCompute.Models.HybridComputeProductFeature HybridComputeProductFeature(string name = null, Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatus? subscriptionStatus = default(Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatus?), System.DateTimeOffset? enrollmentOn = default(System.DateTimeOffset?), System.DateTimeOffset? billingStartOn = default(System.DateTimeOffset?), System.DateTimeOffset? disenrollmentOn = default(System.DateTimeOffset?), System.DateTimeOffset? billingEndOn = default(System.DateTimeOffset?), Azure.ResponseError error = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningIssue HybridComputeProvisioningIssue(string name = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningIssueType? issueType = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningIssueType?), Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningIssueSeverity? severity = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningIssueSeverity?), string description = null, System.Collections.Generic.IEnumerable suggestedResourceIds = null, System.Collections.Generic.IEnumerable suggestedAccessRules = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputeResourceAssociation HybridComputeResourceAssociation(string name = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeAccessMode? accessMode = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeAccessMode?)) { throw null; } - public static Azure.ResourceManager.HybridCompute.Models.HybridComputeTargetResourceSettings HybridComputeTargetResourceSettings(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Guid? tenantId = default(System.Guid?), Azure.Core.ResourceIdentifier gatewayResourceId = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputeWindowsConfiguration HybridComputeWindowsConfiguration(Azure.ResourceManager.HybridCompute.Models.AssessmentModeType? assessmentMode = default(Azure.ResourceManager.HybridCompute.Models.AssessmentModeType?), Azure.ResourceManager.HybridCompute.Models.PatchModeType? patchMode = default(Azure.ResourceManager.HybridCompute.Models.PatchModeType?), bool? isHotpatchingEnabled = default(bool?), Azure.ResourceManager.HybridCompute.Models.HybridComputePatchSettingsStatus status = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.LicenseProfileArmEsuPropertiesWithoutAssignedLicense LicenseProfileArmEsuPropertiesWithoutAssignedLicense(System.Guid? assignedLicenseImmutableId = default(System.Guid?), System.Collections.Generic.IEnumerable esuKeys = null, Azure.ResourceManager.HybridCompute.Models.EsuServerType? serverType = default(Azure.ResourceManager.HybridCompute.Models.EsuServerType?), Azure.ResourceManager.HybridCompute.Models.EsuEligibility? esuEligibility = default(Azure.ResourceManager.HybridCompute.Models.EsuEligibility?), Azure.ResourceManager.HybridCompute.Models.EsuKeyState? esuKeyState = default(Azure.ResourceManager.HybridCompute.Models.EsuKeyState?)) { throw null; } + public static Azure.ResourceManager.HybridCompute.LicenseProfileData LicenseProfileData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningState? provisioningState = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningState?), Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatus? subscriptionStatus = default(Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatus?), Azure.ResourceManager.HybridCompute.Models.LicenseProfileProductType? productType = default(Azure.ResourceManager.HybridCompute.Models.LicenseProfileProductType?), System.DateTimeOffset? enrollmentOn = default(System.DateTimeOffset?), System.DateTimeOffset? billingStartOn = default(System.DateTimeOffset?), System.DateTimeOffset? disenrollmentOn = default(System.DateTimeOffset?), System.DateTimeOffset? billingEndOn = default(System.DateTimeOffset?), Azure.ResponseError error = null, System.Collections.Generic.IEnumerable productFeatures = null, System.Guid? assignedLicenseImmutableId = default(System.Guid?), System.Collections.Generic.IEnumerable esuKeys = null, Azure.ResourceManager.HybridCompute.Models.EsuServerType? serverType = default(Azure.ResourceManager.HybridCompute.Models.EsuServerType?), Azure.ResourceManager.HybridCompute.Models.EsuEligibility? esuEligibility = default(Azure.ResourceManager.HybridCompute.Models.EsuEligibility?), Azure.ResourceManager.HybridCompute.Models.EsuKeyState? esuKeyState = default(Azure.ResourceManager.HybridCompute.Models.EsuKeyState?), string assignedLicense = null, bool? softwareAssuranceCustomer = default(bool?)) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.LicenseProfileMachineInstanceView LicenseProfileMachineInstanceView(Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseStatus? licenseStatus = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseStatus?), string licenseChannel = null, Azure.ResourceManager.HybridCompute.Models.LicenseProfileMachineInstanceViewEsuProperties esuProfile = null, Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatus? subscriptionStatus = default(Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatus?), Azure.ResourceManager.HybridCompute.Models.LicenseProfileProductType? productType = default(Azure.ResourceManager.HybridCompute.Models.LicenseProfileProductType?), System.DateTimeOffset? enrollmentOn = default(System.DateTimeOffset?), System.DateTimeOffset? billingStartOn = default(System.DateTimeOffset?), System.DateTimeOffset? disenrollmentOn = default(System.DateTimeOffset?), System.DateTimeOffset? billingEndOn = default(System.DateTimeOffset?), Azure.ResponseError error = null, System.Collections.Generic.IEnumerable productFeatures = null, bool? isSoftwareAssuranceCustomer = default(bool?)) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.LicenseProfileMachineInstanceViewEsuProperties LicenseProfileMachineInstanceViewEsuProperties(System.Guid? assignedLicenseImmutableId = default(System.Guid?), System.Collections.Generic.IEnumerable esuKeys = null, Azure.ResourceManager.HybridCompute.Models.EsuServerType? serverType = default(Azure.ResourceManager.HybridCompute.Models.EsuServerType?), Azure.ResourceManager.HybridCompute.Models.EsuEligibility? esuEligibility = default(Azure.ResourceManager.HybridCompute.Models.EsuEligibility?), Azure.ResourceManager.HybridCompute.Models.EsuKeyState? esuKeyState = default(Azure.ResourceManager.HybridCompute.Models.EsuKeyState?), Azure.ResourceManager.HybridCompute.HybridComputeLicenseData assignedLicense = null, Azure.ResourceManager.HybridCompute.Models.LicenseAssignmentState? licenseAssignmentState = default(Azure.ResourceManager.HybridCompute.Models.LicenseAssignmentState?)) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.LicenseProfileStorageModelEsuProperties LicenseProfileStorageModelEsuProperties(System.Guid? assignedLicenseImmutableId = default(System.Guid?), System.Collections.Generic.IEnumerable esuKeys = null) { throw null; } @@ -782,10 +701,9 @@ public static partial class ArmHybridComputeModelFactory public static Azure.ResourceManager.HybridCompute.Models.MachineExtensionProperties MachineExtensionProperties(string forceUpdateTag = null, string publisher = null, string machineExtensionPropertiesType = null, string typeHandlerVersion = null, bool? enableAutomaticUpgrade = default(bool?), bool? autoUpgradeMinorVersion = default(bool?), System.Collections.Generic.IDictionary settings = null, System.Collections.Generic.IDictionary protectedSettings = null, string provisioningState = null, Azure.ResourceManager.HybridCompute.Models.MachineExtensionInstanceView instanceView = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.MachineInstallPatchesContent MachineInstallPatchesContent(System.TimeSpan maximumDuration = default(System.TimeSpan), Azure.ResourceManager.HybridCompute.Models.VmGuestPatchRebootSetting rebootSetting = default(Azure.ResourceManager.HybridCompute.Models.VmGuestPatchRebootSetting), Azure.ResourceManager.HybridCompute.Models.HybridComputeWindowsParameters windowsParameters = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeLinuxParameters linuxParameters = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.MachineInstallPatchesResult MachineInstallPatchesResult(Azure.ResourceManager.HybridCompute.Models.MachineOperationStatus? status = default(Azure.ResourceManager.HybridCompute.Models.MachineOperationStatus?), string installationActivityId = null, Azure.ResourceManager.HybridCompute.Models.VmGuestPatchRebootStatus? rebootStatus = default(Azure.ResourceManager.HybridCompute.Models.VmGuestPatchRebootStatus?), bool? maintenanceWindowExceeded = default(bool?), int? excludedPatchCount = default(int?), int? notSelectedPatchCount = default(int?), int? pendingPatchCount = default(int?), int? installedPatchCount = default(int?), int? failedPatchCount = default(int?), System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? lastModifiedOn = default(System.DateTimeOffset?), Azure.ResourceManager.HybridCompute.Models.PatchOperationStartedBy? startedBy = default(Azure.ResourceManager.HybridCompute.Models.PatchOperationStartedBy?), Azure.ResourceManager.HybridCompute.Models.PatchServiceUsed? patchServiceUsed = default(Azure.ResourceManager.HybridCompute.Models.PatchServiceUsed?), Azure.ResourceManager.HybridCompute.Models.HybridComputeOSType? osType = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeOSType?), Azure.ResponseError errorDetails = null) { throw null; } - public static Azure.ResourceManager.HybridCompute.MachineRunCommandData MachineRunCommandData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.HybridCompute.Models.MachineRunCommandScriptSource source = null, System.Collections.Generic.IEnumerable parameters = null, System.Collections.Generic.IEnumerable protectedParameters = null, bool? asyncExecution = default(bool?), string runAsUser = null, string runAsPassword = null, int? timeoutInSeconds = default(int?), System.Uri outputBlobUri = null, System.Uri errorBlobUri = null, Azure.ResourceManager.HybridCompute.Models.RunCommandManagedIdentity outputBlobManagedIdentity = null, Azure.ResourceManager.HybridCompute.Models.RunCommandManagedIdentity errorBlobManagedIdentity = null, string provisioningState = null, Azure.ResourceManager.HybridCompute.Models.MachineRunCommandInstanceView instanceView = null) { throw null; } - public static Azure.ResourceManager.HybridCompute.Models.MachineRunCommandInstanceView MachineRunCommandInstanceView(Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState? executionState = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState?), string executionMessage = null, int? exitCode = default(int?), string output = null, string error = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable statuses = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.NetworkSecurityPerimeter NetworkSecurityPerimeter(string id = null, string perimeterGuid = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?)) { throw null; } public static Azure.ResourceManager.HybridCompute.NetworkSecurityPerimeterConfigurationData NetworkSecurityPerimeterConfigurationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string provisioningState = null, System.Collections.Generic.IEnumerable provisioningIssues = null, Azure.ResourceManager.HybridCompute.Models.NetworkSecurityPerimeter networkSecurityPerimeter = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeResourceAssociation resourceAssociation = null, Azure.ResourceManager.HybridCompute.Models.NetworkSecurityPerimeterProfile profile = null) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.NetworkSecurityPerimeterConfigurationReconcileResult NetworkSecurityPerimeterConfigurationReconcileResult(Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?)) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.NetworkSecurityPerimeterProfile NetworkSecurityPerimeterProfile(string name = null, int? accessRulesVersion = default(int?), System.Collections.Generic.IEnumerable accessRules = null, int? diagnosticSettingsVersion = default(int?), System.Collections.Generic.IEnumerable enabledLogCategories = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.PrivateEndpointConnectionDataModel PrivateEndpointConnectionDataModel(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.HybridCompute.Models.HybridComputePrivateEndpointConnectionProperties properties = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.PrivateLinkScopeValidationDetails PrivateLinkScopeValidationDetails(Azure.Core.ResourceIdentifier id = null, Azure.ResourceManager.HybridCompute.Models.HybridComputePublicNetworkAccessType? publicNetworkAccess = default(Azure.ResourceManager.HybridCompute.Models.HybridComputePublicNetworkAccessType?), System.Collections.Generic.IEnumerable connectionDetails = null) { throw null; } @@ -894,27 +812,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.HybridCompute.Models.EsuServerType left, Azure.ResourceManager.HybridCompute.Models.EsuServerType right) { throw null; } public override string ToString() { throw null; } } - public partial class ExtensionsResourceStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal ExtensionsResourceStatus() { } - public string Code { get { throw null; } } - public string DisplayStatus { get { throw null; } } - public Azure.ResourceManager.HybridCompute.Models.ExtensionsStatusLevelType? Level { get { throw null; } } - public string Message { get { throw null; } } - public System.DateTimeOffset? Time { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.HybridCompute.Models.ExtensionsResourceStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.HybridCompute.Models.ExtensionsResourceStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public enum ExtensionsStatusLevelType - { - Info = 0, - Warning = 1, - Error = 2, - } public partial class ExtensionTargetProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ExtensionTargetProperties() { } @@ -1024,57 +921,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct HybridComputeExecutionState : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public HybridComputeExecutionState(string value) { throw null; } - public static Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState Canceled { get { throw null; } } - public static Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState Failed { get { throw null; } } - public static Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState Pending { get { throw null; } } - public static Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState Running { get { throw null; } } - public static Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState Succeeded { get { throw null; } } - public static Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState TimedOut { get { throw null; } } - public static Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState Unknown { get { throw null; } } - public bool Equals(Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState left, Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState right) { throw null; } - public static implicit operator Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState left, Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState right) { throw null; } - public override string ToString() { throw null; } - } - public partial class HybridComputeGatewayPatch : Azure.ResourceManager.HybridCompute.Models.HybridComputeResourceUpdate, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public HybridComputeGatewayPatch() { } - public System.Collections.Generic.IList AllowedFeatures { get { throw null; } } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.HybridCompute.Models.HybridComputeGatewayPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.HybridCompute.Models.HybridComputeGatewayPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] - public readonly partial struct HybridComputeGatewayType : System.IEquatable - { - private readonly object _dummy; - private readonly int _dummyPrimitive; - public HybridComputeGatewayType(string value) { throw null; } - public static Azure.ResourceManager.HybridCompute.Models.HybridComputeGatewayType Public { get { throw null; } } - public bool Equals(Azure.ResourceManager.HybridCompute.Models.HybridComputeGatewayType other) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override bool Equals(object obj) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public override int GetHashCode() { throw null; } - public static bool operator ==(Azure.ResourceManager.HybridCompute.Models.HybridComputeGatewayType left, Azure.ResourceManager.HybridCompute.Models.HybridComputeGatewayType right) { throw null; } - public static implicit operator Azure.ResourceManager.HybridCompute.Models.HybridComputeGatewayType (string value) { throw null; } - public static bool operator !=(Azure.ResourceManager.HybridCompute.Models.HybridComputeGatewayType left, Azure.ResourceManager.HybridCompute.Models.HybridComputeGatewayType right) { throw null; } - public override string ToString() { throw null; } - } public partial class HybridComputeIPAddress : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal HybridComputeIPAddress() { } @@ -1625,18 +1471,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.HybridCompute.Models.HybridComputeStatusType left, Azure.ResourceManager.HybridCompute.Models.HybridComputeStatusType right) { throw null; } public override string ToString() { throw null; } } - public partial class HybridComputeTargetResourceSettings : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public HybridComputeTargetResourceSettings() { } - public Azure.Core.ResourceIdentifier GatewayResourceId { get { throw null; } set { } } - public System.Guid? TenantId { get { throw null; } } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.HybridCompute.Models.HybridComputeTargetResourceSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.HybridCompute.Models.HybridComputeTargetResourceSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } public partial class HybridComputeWindowsConfiguration : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public HybridComputeWindowsConfiguration() { } @@ -1767,6 +1601,21 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class LicenseProfilePatch : Azure.ResourceManager.HybridCompute.Models.HybridComputeResourceUpdate, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public LicenseProfilePatch() { } + public string AssignedLicense { get { throw null; } set { } } + public System.Collections.Generic.IList ProductFeatures { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.LicenseProfileProductType? ProductType { get { throw null; } set { } } + public bool? SoftwareAssuranceCustomer { get { throw null; } set { } } + public Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatusUpdate? SubscriptionStatus { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.LicenseProfilePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.LicenseProfilePatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct LicenseProfileProductType : System.IEquatable { @@ -1819,6 +1668,24 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatus left, Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatus right) { throw null; } public override string ToString() { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct LicenseProfileSubscriptionStatusUpdate : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public LicenseProfileSubscriptionStatusUpdate(string value) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatusUpdate Disable { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatusUpdate Enable { get { throw null; } } + public bool Equals(Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatusUpdate other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatusUpdate left, Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatusUpdate right) { throw null; } + public static implicit operator Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatusUpdate (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatusUpdate left, Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatusUpdate right) { throw null; } + public override string ToString() { throw null; } + } public partial class MachineAssessPatchesResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal MachineAssessPatchesResult() { } @@ -1959,38 +1826,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.HybridCompute.Models.MachineOperationStatus left, Azure.ResourceManager.HybridCompute.Models.MachineOperationStatus right) { throw null; } public override string ToString() { throw null; } } - public partial class MachineRunCommandInstanceView : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - internal MachineRunCommandInstanceView() { } - public System.DateTimeOffset? EndOn { get { throw null; } } - public string Error { get { throw null; } } - public string ExecutionMessage { get { throw null; } } - public Azure.ResourceManager.HybridCompute.Models.HybridComputeExecutionState? ExecutionState { get { throw null; } } - public int? ExitCode { get { throw null; } } - public string Output { get { throw null; } } - public System.DateTimeOffset? StartOn { get { throw null; } } - public System.Collections.Generic.IReadOnlyList Statuses { get { throw null; } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.HybridCompute.Models.MachineRunCommandInstanceView System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.HybridCompute.Models.MachineRunCommandInstanceView System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class MachineRunCommandScriptSource : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public MachineRunCommandScriptSource() { } - public string CommandId { get { throw null; } set { } } - public string Script { get { throw null; } set { } } - public System.Uri ScriptUri { get { throw null; } set { } } - public Azure.ResourceManager.HybridCompute.Models.RunCommandManagedIdentity ScriptUriManagedIdentity { get { throw null; } set { } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.HybridCompute.Models.MachineRunCommandScriptSource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.HybridCompute.Models.MachineRunCommandScriptSource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } public partial class NetworkSecurityPerimeter : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal NetworkSecurityPerimeter() { } @@ -2004,6 +1839,17 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class NetworkSecurityPerimeterConfigurationReconcileResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NetworkSecurityPerimeterConfigurationReconcileResult() { } + public Azure.Core.AzureLocation? Location { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.NetworkSecurityPerimeterConfigurationReconcileResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.NetworkSecurityPerimeterConfigurationReconcileResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class NetworkSecurityPerimeterProfile : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal NetworkSecurityPerimeterProfile() { } @@ -2103,29 +1949,17 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class RunCommandInputParameter : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class ProductFeatureUpdate : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public RunCommandInputParameter(string name, string value) { } + public ProductFeatureUpdate() { } public string Name { get { throw null; } set { } } - public string Value { get { throw null; } set { } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.HybridCompute.Models.RunCommandInputParameter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.HybridCompute.Models.RunCommandInputParameter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class RunCommandManagedIdentity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public RunCommandManagedIdentity() { } - public System.Guid? ClientId { get { throw null; } set { } } - public System.Guid? ObjectId { get { throw null; } set { } } + public Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatusUpdate? SubscriptionStatus { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.HybridCompute.Models.RunCommandManagedIdentity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.HybridCompute.Models.RunCommandManagedIdentity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.HybridCompute.Models.ProductFeatureUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.ProductFeatureUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct VmGuestPatchClassificationLinux : System.IEquatable diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/HybridComputeManagementTestBase.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/HybridComputeManagementTestBase.cs index fbdafe8f910da..b2db5b3e518db 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/HybridComputeManagementTestBase.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/HybridComputeManagementTestBase.cs @@ -25,9 +25,9 @@ public class HybridComputeManagementTestBase : ManagementRecordedTestBase getPrivat return connectionCollection; } - protected async Task createRunCommand() - { - HybridComputeMachineResource hybridComputeMachine = await collection.GetAsync(machineName); - MachineRunCommandCollection runCommandCollection = hybridComputeMachine.GetMachineRunCommands(); - - MachineRunCommandData data = new MachineRunCommandData(new AzureLocation("centraluseuap")) - { - Source = new MachineRunCommandScriptSource() - { - Script = "Write-Host Hello World!", - }, - Parameters = - { - new RunCommandInputParameter("param1","value1"), new RunCommandInputParameter("param2","value2") - }, - // AsyncExecution = false, - // RunAsUser = "user1", - // RunAsPassword = "", - // TimeoutInSeconds = 3600, - // OutputBlobUri = new Uri("https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt"), - // ErrorBlobUri = new Uri("https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt"), - }; - ArmOperation lro = await runCommandCollection.CreateOrUpdateAsync(WaitUntil.Completed, runCommandName, data); - MachineRunCommandResource result = lro.Value; - - return result.Data; - } - - protected async Task updateRunCommand() - { - ResourceIdentifier machineRunCommandResourceId = MachineRunCommandResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, machineName, runCommandName); - MachineRunCommandResource machineRunCommand = ArmClient.GetMachineRunCommandResource(machineRunCommandResourceId); - - MachineRunCommandData data = new MachineRunCommandData(new AzureLocation("centraluseuap")) - { - Source = new MachineRunCommandScriptSource() - { - Script = "Write-Host Hello World!", - }, - Parameters = - { - new RunCommandInputParameter("param1","value1"), new RunCommandInputParameter("param2","value2") - }, - // AsyncExecution = false, - // RunAsUser = "user1", - // RunAsPassword = "", - // TimeoutInSeconds = 3600, - // OutputBlobUri = new Uri("https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt"), - // ErrorBlobUri = new Uri("https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt"), - Tags = - { - ["Tag1"] = "Value1", - ["Tag2"] = "Value2", - }, - }; - ArmOperation lro = await machineRunCommand.UpdateAsync(WaitUntil.Completed, data); - MachineRunCommandResource result = lro.Value; - - return result.Data; - } - - protected async Task getRunCommand() - { - HybridComputeMachineResource hybridComputeMachine = await collection.GetAsync(machineName); - MachineRunCommandCollection runCommandCollection = hybridComputeMachine.GetMachineRunCommands(); - - MachineRunCommandResource result = await runCommandCollection.GetAsync(runCommandName); - - return result.Data; - } - - protected async Task getRunCommandCollection() - { - HybridComputeMachineResource hybridComputeMachine = await collection.GetAsync(machineName); - MachineRunCommandCollection runCommandCollection = hybridComputeMachine.GetMachineRunCommands(); - - await foreach (MachineRunCommandResource item in runCommandCollection.GetAllAsync()) - { - MachineRunCommandData resourceData = item.Data; - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } - - return runCommandCollection; - } + // protected async Task createRunCommand() + // { + // HybridComputeMachineResource hybridComputeMachine = await collection.GetAsync(machineName); + // MachineRunCommandCollection runCommandCollection = hybridComputeMachine.GetMachineRunCommands(); + + // MachineRunCommandData data = new MachineRunCommandData(new AzureLocation("centraluseuap")) + // { + // Source = new MachineRunCommandScriptSource() + // { + // Script = "Write-Host Hello World!", + // }, + // Parameters = + // { + // new RunCommandInputParameter("param1","value1"), new RunCommandInputParameter("param2","value2") + // }, + // // AsyncExecution = false, + // // RunAsUser = "user1", + // // RunAsPassword = "", + // // TimeoutInSeconds = 3600, + // // OutputBlobUri = new Uri("https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt"), + // // ErrorBlobUri = new Uri("https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt"), + // }; + // ArmOperation lro = await runCommandCollection.CreateOrUpdateAsync(WaitUntil.Completed, runCommandName, data); + // MachineRunCommandResource result = lro.Value; + + // return result.Data; + // } + + // protected async Task updateRunCommand() + // { + // ResourceIdentifier machineRunCommandResourceId = MachineRunCommandResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, machineName, runCommandName); + // MachineRunCommandResource machineRunCommand = ArmClient.GetMachineRunCommandResource(machineRunCommandResourceId); + + // MachineRunCommandData data = new MachineRunCommandData(new AzureLocation("centraluseuap")) + // { + // Source = new MachineRunCommandScriptSource() + // { + // Script = "Write-Host Hello World!", + // }, + // Parameters = + // { + // new RunCommandInputParameter("param1","value1"), new RunCommandInputParameter("param2","value2") + // }, + // // AsyncExecution = false, + // // RunAsUser = "user1", + // // RunAsPassword = "", + // // TimeoutInSeconds = 3600, + // // OutputBlobUri = new Uri("https://mystorageaccount.blob.core.windows.net/myscriptoutputcontainer/MyScriptoutput.txt"), + // // ErrorBlobUri = new Uri("https://mystorageaccount.blob.core.windows.net/mycontainer/MyScriptError.txt"), + // Tags = + // { + // ["Tag1"] = "Value1", + // ["Tag2"] = "Value2", + // }, + // }; + // ArmOperation lro = await machineRunCommand.UpdateAsync(WaitUntil.Completed, data); + // MachineRunCommandResource result = lro.Value; + + // return result.Data; + // } + + // protected async Task getRunCommand() + // { + // HybridComputeMachineResource hybridComputeMachine = await collection.GetAsync(machineName); + // MachineRunCommandCollection runCommandCollection = hybridComputeMachine.GetMachineRunCommands(); + + // MachineRunCommandResource result = await runCommandCollection.GetAsync(runCommandName); + + // return result.Data; + // } + + // protected async Task getRunCommandCollection() + // { + // HybridComputeMachineResource hybridComputeMachine = await collection.GetAsync(machineName); + // MachineRunCommandCollection runCommandCollection = hybridComputeMachine.GetMachineRunCommands(); + + // await foreach (MachineRunCommandResource item in runCommandCollection.GetAllAsync()) + // { + // MachineRunCommandData resourceData = item.Data; + // Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + // } + + // return runCommandCollection; + // } protected async Task createEsuLicense() { @@ -514,6 +514,18 @@ protected async Task getNsp() return result.Data; } + protected async Task invokeNsp() + { + ResourceIdentifier networkSecurityPerimeterConfigurationResourceId = NetworkSecurityPerimeterConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, privateLinkScopeNameNSP, perimeterName); + NetworkSecurityPerimeterConfigurationResource networkSecurityPerimeterConfiguration = ArmClient.GetNetworkSecurityPerimeterConfigurationResource(networkSecurityPerimeterConfigurationResourceId); + + // invoke the operation + ArmOperation lro = await networkSecurityPerimeterConfiguration.ReconcileForPrivateLinkScopeAsync(WaitUntil.Completed); + NetworkSecurityPerimeterConfigurationReconcileResult result = lro.Value; + + Console.WriteLine($"Invoke NSP Succeeded"); + } + protected async Task deleteEsuLicense() { ResourceIdentifier hybridComputeLicenseResourceId = HybridComputeLicenseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, esuLicenseName); @@ -524,16 +536,16 @@ protected async Task deleteEsuLicense() Console.WriteLine($"Delete ESU License Succeeded"); } - protected async Task deleteRunCommand() - { - HybridComputeMachineResource hybridComputeMachine = await collection.GetAsync(machineName); - MachineRunCommandCollection runCommandCollection = hybridComputeMachine.GetMachineRunCommands(); + // protected async Task deleteRunCommand() + // { + // HybridComputeMachineResource hybridComputeMachine = await collection.GetAsync(machineName); + // MachineRunCommandCollection runCommandCollection = hybridComputeMachine.GetMachineRunCommands(); - MachineRunCommandResource result = await runCommandCollection.GetAsync(runCommandName); + // MachineRunCommandResource result = await runCommandCollection.GetAsync(runCommandName); - await result.DeleteAsync(WaitUntil.Completed); - Console.WriteLine($"Delete Machine Run Command Succeeded"); - } + // await result.DeleteAsync(WaitUntil.Completed); + // Console.WriteLine($"Delete Machine Run Command Succeeded"); + // } protected async Task deletePrivateLinkScope() { diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/Scenario/HybridComputeManagementNspTest.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/Scenario/HybridComputeManagementNspTest.cs index 2b9aa5d30cc4d..b6316ce3a4439 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/Scenario/HybridComputeManagementNspTest.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/Scenario/HybridComputeManagementNspTest.cs @@ -41,5 +41,12 @@ public async Task CanGetNspCollection() NetworkSecurityPerimeterConfigurationCollection resourceCollection = await getNspCollection(); Assert.IsNotNull(resourceCollection); } + + [TestCase] + [RecordedTest] + public async Task CanInvokeNsp() + { + await invokeNsp(); + } } } From 1429b311ab27b1e146e1a06ed85b1c71bfede4df Mon Sep 17 00:00:00 2001 From: Yao Tong Date: Mon, 14 Oct 2024 02:06:59 -0400 Subject: [PATCH 03/14] update tests --- .../CHANGELOG.md | 10 +-- .../tests/HybridComputeManagementTestBase.cs | 34 +++++----- ...ComputeManagementMachineRunCommandsTest.cs | 68 ------------------- .../HybridComputeManagementMachineTest.cs | 20 +++--- 4 files changed, 29 insertions(+), 103 deletions(-) delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/Scenario/HybridComputeManagementMachineRunCommandsTest.cs diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/CHANGELOG.md b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/CHANGELOG.md index 8ca98d6c11b06..b982dda961f0e 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/CHANGELOG.md +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/CHANGELOG.md @@ -1,16 +1,10 @@ # Release History -## 1.0.0-beta.11 (Unreleased) - -### Features Added - -- Exposed `JsonModelWriteCore` for model serialization procedure. +## 1.0.0 (2024-10-13) ### Breaking Changes -### Bugs Fixed - -### Other Changes +- Upgraded api-version tag from 'package-preview-2024-05' to 'package-2024-07'. Tag detail available at https://github.com/Azure/azure-rest-api-specs/blob/15b16d1b5c3cccdecdd1cfe936f6a8005680c557/specification/hybridcompute/resource-manager/readme.md ## 1.0.0-beta.10 (2024-07-19) diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/HybridComputeManagementTestBase.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/HybridComputeManagementTestBase.cs index b2db5b3e518db..1d2d53782a5ff 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/HybridComputeManagementTestBase.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/HybridComputeManagementTestBase.cs @@ -26,11 +26,11 @@ public class HybridComputeManagementTestBase : ManagementRecordedTestBase installPatch() VmGuestPatchClassificationWindow.Critical,VmGuestPatchClassificationWindow.Security }, // The maximum published date for patches must be a DateTime value between last patch Tuesday and a week from today - MaxPatchPublishOn = DateTimeOffset.Parse("2024-05-30T02:36:43.0539904+00:00"), + MaxPatchPublishOn = DateTimeOffset.Parse("2024-10-15T02:36:43.0539904+00:00"), }, }; ArmOperation lro = await hybridComputeMachine.InstallPatchesAsync(WaitUntil.Completed, content); @@ -141,16 +141,16 @@ protected async Task createMachineExtension() HybridComputeMachineResource hybridComputeMachine = await collection.GetAsync(machineName); HybridComputeMachineExtensionCollection extensionCollection = hybridComputeMachine.GetHybridComputeMachineExtensions(); - HybridComputeMachineExtensionData data = new HybridComputeMachineExtensionData(new AzureLocation("centraluseuap")) + HybridComputeMachineExtensionData data = new HybridComputeMachineExtensionData(new AzureLocation("eastus")) { Properties = new MachineExtensionProperties() { - Publisher = "Microsoft.Compute", - MachineExtensionPropertiesType = "CustomScriptExtension", - TypeHandlerVersion = "1.10", + Publisher = "Microsoft.Azure.NetworkWatcher", + MachineExtensionPropertiesType = "NetworkWatcherAgentWindows", + TypeHandlerVersion = "1.4.2798.3", Settings = { - ["commandToExecute"] = new BinaryData("\"hostname\""), + ["commandToExecute"] = new BinaryData("\"dir\""), }, }, }; @@ -167,13 +167,13 @@ protected async Task updateMachineExtension() HybridComputeMachineExtensionPatch patch = new HybridComputeMachineExtensionPatch() { - Publisher = "Microsoft.Compute", - MachineExtensionUpdatePropertiesType = "CustomScriptExtension", - TypeHandlerVersion = "1.10", + Publisher = "Microsoft.Azure.NetworkWatcher", + MachineExtensionUpdatePropertiesType = "NetworkWatcherAgentWindows", + TypeHandlerVersion = "1.4.2798.3", EnableAutomaticUpgrade = true, Settings = { - ["commandToExecute"] = new BinaryData("\"hostname\""), + ["commandToExecute"] = new BinaryData("\"powershell.exe ls\""), }, }; ArmOperation lro = await hybridComputeMachineExtension.UpdateAsync(WaitUntil.Completed, patch); @@ -210,7 +210,7 @@ protected async Task createPrivateLinkScope() { HybridComputePrivateLinkScopeCollection scopeCollection = resourceGroupResource.GetHybridComputePrivateLinkScopes(); - HybridComputePrivateLinkScopeData data = new HybridComputePrivateLinkScopeData(new AzureLocation("centraluseuap")) + HybridComputePrivateLinkScopeData data = new HybridComputePrivateLinkScopeData(new AzureLocation("eastus")) { Properties = new HybridComputePrivateLinkScopeProperties() { @@ -425,7 +425,7 @@ protected async Task createEsuLicense() { HybridComputeLicenseCollection esuLicensecollection = resourceGroupResource.GetHybridComputeLicenses(); - HybridComputeLicenseData data = new HybridComputeLicenseData(new AzureLocation("centraluseuap")) + HybridComputeLicenseData data = new HybridComputeLicenseData(new AzureLocation("eastus")) { LicenseType = "ESU", LicenseDetails = new HybridComputeLicenseDetails() @@ -469,7 +469,7 @@ protected async Task updateEsuLicense() ResourceIdentifier hybridComputeLicenseResourceId = HybridComputeLicenseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, esuLicenseName); HybridComputeLicenseResource hybridComputeLicense = ArmClient.GetHybridComputeLicenseResource(hybridComputeLicenseResourceId); - HybridComputeLicenseData data = new HybridComputeLicenseData(new AzureLocation("centraluseuap")) + HybridComputeLicenseData data = new HybridComputeLicenseData(new AzureLocation("eastus")) { LicenseType = "ESU", LicenseDetails = new HybridComputeLicenseDetails() @@ -516,7 +516,7 @@ protected async Task getNsp() protected async Task invokeNsp() { - ResourceIdentifier networkSecurityPerimeterConfigurationResourceId = NetworkSecurityPerimeterConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, privateLinkScopeNameNSP, perimeterName); + ResourceIdentifier networkSecurityPerimeterConfigurationResourceId = NetworkSecurityPerimeterConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupNameNSP, privateLinkScopeNameNSP, perimeterName); NetworkSecurityPerimeterConfigurationResource networkSecurityPerimeterConfiguration = ArmClient.GetNetworkSecurityPerimeterConfigurationResource(networkSecurityPerimeterConfigurationResourceId); // invoke the operation diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/Scenario/HybridComputeManagementMachineRunCommandsTest.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/Scenario/HybridComputeManagementMachineRunCommandsTest.cs deleted file mode 100644 index 086238d23d493..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/Scenario/HybridComputeManagementMachineRunCommandsTest.cs +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.Threading.Tasks; -using Azure.Core.TestFramework; -using Azure.ResourceManager.HybridCompute; -using NUnit.Framework; -using Azure.Core; -using Azure.ResourceManager.HybridCompute.Models; -using System.Diagnostics; - -namespace Azure.ResourceManager.HybridCompute.Tests.Scenario -{ - public class HybridComputeManagementMachineRunCommandsTest : HybridComputeManagementTestBase - { - public HybridComputeManagementMachineRunCommandsTest(bool isAsync) : base(isAsync) - { - } - - [SetUp] - public async Task ClearAndInitialize() - { - if (Mode == RecordedTestMode.Record || Mode == RecordedTestMode.Playback) - { - await InitializeClients(); - } - } - - [TestCase] - [RecordedTest] - public async Task CanCreateMachineRunCommand() - { - MachineRunCommandData resourceData = await createRunCommand(); - Assert.AreEqual(runCommandName, resourceData.Name); - } - - [TestCase] - [RecordedTest] - public async Task CanUpdateMachineRunCommand() - { - MachineRunCommandData resourceData = await updateRunCommand(); - Assert.AreEqual(runCommandName, resourceData.Name); - } - - [TestCase] - [RecordedTest] - public async Task CanGetMachineRunCommand() - { - MachineRunCommandData resourceData = await getRunCommand(); - Assert.AreEqual(runCommandName, resourceData.Name); - } - - [TestCase] - [RecordedTest] - public async Task CanGetMachineRunCommandCollection() - { - MachineRunCommandCollection resourceCollection = await getRunCommandCollection(); - string collectionId = "/subscriptions/" + subscriptionId + "/resourceGroups/" + resourceGroupName + "/providers/Microsoft.HybridCompute/machines/" + machineName; - Assert.AreEqual(collectionId, resourceCollection.Id.ToString()); - } - - [TestCase] - [RecordedTest] - public async Task CanDeleteMachineRunCommand(){ - await deleteRunCommand(); - } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/Scenario/HybridComputeManagementMachineTest.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/Scenario/HybridComputeManagementMachineTest.cs index e78a794ec6175..6033aee95d75f 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/Scenario/HybridComputeManagementMachineTest.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/tests/Scenario/HybridComputeManagementMachineTest.cs @@ -48,16 +48,6 @@ public async Task CanGetMachineCollection() Assert.AreEqual(collectionId, resourceCollection.Id.ToString()); } - [TestCase] - [RecordedTest] - public async Task CanUpdateMachine() - { - HybridComputeMachineData resourceData = await updateMachine(); - - Debug.WriteLine($"Succeeded on id: {resourceData.Id}"); - Assert.AreEqual(machineName, resourceData.Name.ToString()); - } - [TestCase] [RecordedTest] public async Task CanInstallPatch(){ @@ -74,6 +64,16 @@ public async Task CanAssessPatch(){ Assert.AreEqual("Succeeded", resourceData.Status.ToString()); } + [TestCase] + [RecordedTest] + public async Task CanUpdateMachine() + { + HybridComputeMachineData resourceData = await updateMachine(); + + Debug.WriteLine($"Succeeded on id: {resourceData.Id}"); + Assert.AreEqual(machineName, resourceData.Name.ToString()); + } + [TestCase] [RecordedTest] public async Task CanDeleteMachine(){ From 353d7e9dc8fac92171832b8521b2022cda7eadc9 Mon Sep 17 00:00:00 2001 From: Yao Tong Date: Mon, 14 Oct 2024 02:14:56 -0400 Subject: [PATCH 04/14] update assets.json --- .../Azure.ResourceManager.HybridCompute/assets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/assets.json b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/assets.json index 1bcd804a8b053..edcbd4b958603 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/assets.json +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/hybridcompute/Azure.ResourceManager.HybridCompute", - "Tag": "net/hybridcompute/Azure.ResourceManager.HybridCompute_2df9be5e7a" + "Tag": "net/hybridcompute/Azure.ResourceManager.HybridCompute_795660094f" } From a2c57a71e337f257e4f7c35b2992df296a2ca017 Mon Sep 17 00:00:00 2001 From: Yao Tong Date: Mon, 14 Oct 2024 13:33:16 -0400 Subject: [PATCH 05/14] update version number --- .../Azure.ResourceManager.HybridCompute/CHANGELOG.md | 2 ++ sdk/hybridcompute/Azure.ResourceManager.HybridCompute/README.md | 2 +- .../src/Azure.ResourceManager.HybridCompute.csproj | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/CHANGELOG.md b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/CHANGELOG.md index b982dda961f0e..57e163eadcd6d 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/CHANGELOG.md +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/CHANGELOG.md @@ -2,6 +2,8 @@ ## 1.0.0 (2024-10-13) +This is the first stable release of the Hybrid Compute library. + ### Breaking Changes - Upgraded api-version tag from 'package-preview-2024-05' to 'package-2024-07'. Tag detail available at https://github.com/Azure/azure-rest-api-specs/blob/15b16d1b5c3cccdecdd1cfe936f6a8005680c557/specification/hybridcompute/resource-manager/readme.md diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/README.md b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/README.md index 1a63e86ccd165..bf4670cca4dad 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/README.md +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/README.md @@ -17,7 +17,7 @@ This library follows the [new Azure SDK guidelines](https://azure.github.io/azur Install the Microsoft Azure Hybrid Compute management library for .NET with [NuGet](https://www.nuget.org/): ```dotnetcli -dotnet add package Azure.ResourceManager.HybridCompute --prerelease +dotnet add package Azure.ResourceManager.HybridCompute ``` ### Prerequisites diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Azure.ResourceManager.HybridCompute.csproj b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Azure.ResourceManager.HybridCompute.csproj index be1444282e509..f82e844753072 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Azure.ResourceManager.HybridCompute.csproj +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Azure.ResourceManager.HybridCompute.csproj @@ -1,6 +1,6 @@ - 1.0.0-beta.11 + 1.0.0 Azure.ResourceManager.HybridCompute Microsoft Azure Resource Manager client SDK for Azure resource provider Microsoft.HybridCompute. azure;management;arm;resource manager;hybridcompute From f9b7bb0909b5b2908fe8c8a1822f2a8aa390f471 Mon Sep 17 00:00:00 2001 From: Yao Tong Date: Tue, 15 Oct 2024 16:46:56 -0400 Subject: [PATCH 06/14] update assets.json --- .../Azure.ResourceManager.HybridCompute/assets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/assets.json b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/assets.json index edcbd4b958603..e8ebdc8aba29d 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/assets.json +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/hybridcompute/Azure.ResourceManager.HybridCompute", - "Tag": "net/hybridcompute/Azure.ResourceManager.HybridCompute_795660094f" + "Tag": "net/hybridcompute/Azure.ResourceManager.HybridCompute_f3c5ffccb0" } From 2e43015ae69631f7c909ad508bb065bb24453986 Mon Sep 17 00:00:00 2001 From: Yao Tong Date: Tue, 15 Oct 2024 18:04:48 -0400 Subject: [PATCH 07/14] update assets.json --- .../Azure.ResourceManager.HybridCompute/assets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/assets.json b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/assets.json index e8ebdc8aba29d..c3a89f0441294 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/assets.json +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/hybridcompute/Azure.ResourceManager.HybridCompute", - "Tag": "net/hybridcompute/Azure.ResourceManager.HybridCompute_f3c5ffccb0" + "Tag": "net/hybridcompute/Azure.ResourceManager.HybridCompute_834d228850" } From 89b7eabea60d4b82f2b8e2e870394cd30d465c5e Mon Sep 17 00:00:00 2001 From: Yao Tong Date: Wed, 16 Oct 2024 12:56:00 -0400 Subject: [PATCH 08/14] update assets.json --- .../Azure.ResourceManager.HybridCompute/assets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/assets.json b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/assets.json index c3a89f0441294..14521e5f7d24c 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/assets.json +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/hybridcompute/Azure.ResourceManager.HybridCompute", - "Tag": "net/hybridcompute/Azure.ResourceManager.HybridCompute_834d228850" + "Tag": "net/hybridcompute/Azure.ResourceManager.HybridCompute_c2030f7666" } From 425f2e134bc6cf2e593d1ba9ce137de9caf94509 Mon Sep 17 00:00:00 2001 From: Yao Tong Date: Wed, 16 Oct 2024 15:11:14 -0400 Subject: [PATCH 09/14] update assets.json --- .../Azure.ResourceManager.HybridCompute/assets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/assets.json b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/assets.json index 14521e5f7d24c..7b6094ba06864 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/assets.json +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/hybridcompute/Azure.ResourceManager.HybridCompute", - "Tag": "net/hybridcompute/Azure.ResourceManager.HybridCompute_c2030f7666" + "Tag": "net/hybridcompute/Azure.ResourceManager.HybridCompute_a5021d00b6" } From 308cb066f4485879c7694d4c9aac222918aa5e24 Mon Sep 17 00:00:00 2001 From: Yao Tong Date: Wed, 16 Oct 2024 15:47:07 -0400 Subject: [PATCH 10/14] update assets.json --- .../Azure.ResourceManager.HybridCompute/assets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/assets.json b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/assets.json index 7b6094ba06864..5cb272e590b5d 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/assets.json +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/hybridcompute/Azure.ResourceManager.HybridCompute", - "Tag": "net/hybridcompute/Azure.ResourceManager.HybridCompute_a5021d00b6" + "Tag": "net/hybridcompute/Azure.ResourceManager.HybridCompute_a837b681f8" } From 5219b9367e624b9335c7d0a9f0613e917576526d Mon Sep 17 00:00:00 2001 From: yaotongms <137821665+yaotongms@users.noreply.github.com> Date: Thu, 17 Oct 2024 12:33:49 -0400 Subject: [PATCH 11/14] Update sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LicenseProfileData.cs Co-authored-by: Mingzhe Huang --- .../src/Generated/LicenseProfileData.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LicenseProfileData.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LicenseProfileData.cs index 42e13cbece5aa..5f81b02ff8ef2 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LicenseProfileData.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LicenseProfileData.cs @@ -156,6 +156,6 @@ internal LicenseProfileData() public string AssignedLicense { get; set; } /// Specifies if this machine is licensed as part of a Software Assurance agreement. [WirePath("properties.softwareAssuranceCustomer")] - public bool? SoftwareAssuranceCustomer { get; set; } + public bool? IsSoftwareAssuranceCustomer { get; set; } } } From d173fe52d6655bef76229efcf402826a1b0fd1d2 Mon Sep 17 00:00:00 2001 From: Yao Tong Date: Thu, 17 Oct 2024 13:05:11 -0400 Subject: [PATCH 12/14] rename property --- ...rceManager.HybridCompute.netstandard2.0.cs | 26 ++++++------- .../Samples/Sample_LicenseProfileResource.cs | 2 +- ...puteProductFeatureUpdate.Serialization.cs} | 38 +++++++++---------- ...s => HybridComputeProductFeatureUpdate.cs} | 10 ++--- .../LicenseProfilePatch.Serialization.cs | 8 ++-- .../Generated/Models/LicenseProfilePatch.cs | 6 +-- .../src/autorest.md | 3 ++ 7 files changed, 48 insertions(+), 45 deletions(-) rename sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/{ProductFeatureUpdate.Serialization.cs => HybridComputeProductFeatureUpdate.Serialization.cs} (65%) rename sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/{ProductFeatureUpdate.cs => HybridComputeProductFeatureUpdate.cs} (82%) diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/api/Azure.ResourceManager.HybridCompute.netstandard2.0.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/api/Azure.ResourceManager.HybridCompute.netstandard2.0.cs index c86a3573af7a3..d4c2672491b6c 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/api/Azure.ResourceManager.HybridCompute.netstandard2.0.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/api/Azure.ResourceManager.HybridCompute.netstandard2.0.cs @@ -1270,6 +1270,18 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class HybridComputeProductFeatureUpdate : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HybridComputeProductFeatureUpdate() { } + public string Name { get { throw null; } set { } } + public Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatusUpdate? SubscriptionStatus { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.HybridComputeProductFeatureUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.HybridComputeProductFeatureUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct HybridComputeProgramYear : System.IEquatable { @@ -1605,7 +1617,7 @@ public partial class LicenseProfilePatch : Azure.ResourceManager.HybridCompute.M { public LicenseProfilePatch() { } public string AssignedLicense { get { throw null; } set { } } - public System.Collections.Generic.IList ProductFeatures { get { throw null; } } + public System.Collections.Generic.IList ProductFeatures { get { throw null; } } public Azure.ResourceManager.HybridCompute.Models.LicenseProfileProductType? ProductType { get { throw null; } set { } } public bool? SoftwareAssuranceCustomer { get { throw null; } set { } } public Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatusUpdate? SubscriptionStatus { get { throw null; } set { } } @@ -1949,18 +1961,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class ProductFeatureUpdate : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public ProductFeatureUpdate() { } - public string Name { get { throw null; } set { } } - public Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatusUpdate? SubscriptionStatus { get { throw null; } set { } } - protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.HybridCompute.Models.ProductFeatureUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.HybridCompute.Models.ProductFeatureUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct VmGuestPatchClassificationLinux : System.IEquatable { diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_LicenseProfileResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_LicenseProfileResource.cs index 4581d2961c48c..ccc84edeade5b 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_LicenseProfileResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_LicenseProfileResource.cs @@ -90,7 +90,7 @@ public async Task Update_UpdateALicenseProfile() ProductType = LicenseProfileProductType.WindowsServer, ProductFeatures = { -new ProductFeatureUpdate() +new HybridComputeProductFeatureUpdate() { Name = "Hotpatch", SubscriptionStatus = LicenseProfileSubscriptionStatusUpdate.Enable, diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ProductFeatureUpdate.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeProductFeatureUpdate.Serialization.cs similarity index 65% rename from sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ProductFeatureUpdate.Serialization.cs rename to sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeProductFeatureUpdate.Serialization.cs index c700473a1b7db..a43cd43682f12 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ProductFeatureUpdate.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeProductFeatureUpdate.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.HybridCompute.Models { - public partial class ProductFeatureUpdate : IUtf8JsonSerializable, IJsonModel + public partial class HybridComputeProductFeatureUpdate : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr /// The client options for reading and writing models. protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ProductFeatureUpdate)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(HybridComputeProductFeatureUpdate)} does not support writing '{format}' format."); } if (Optional.IsDefined(Name)) @@ -61,19 +61,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ProductFeatureUpdate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + HybridComputeProductFeatureUpdate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ProductFeatureUpdate)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(HybridComputeProductFeatureUpdate)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeProductFeatureUpdate(document.RootElement, options); + return DeserializeHybridComputeProductFeatureUpdate(document.RootElement, options); } - internal static ProductFeatureUpdate DeserializeProductFeatureUpdate(JsonElement element, ModelReaderWriterOptions options = null) + internal static HybridComputeProductFeatureUpdate DeserializeHybridComputeProductFeatureUpdate(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -107,38 +107,38 @@ internal static ProductFeatureUpdate DeserializeProductFeatureUpdate(JsonElement } } serializedAdditionalRawData = rawDataDictionary; - return new ProductFeatureUpdate(name, subscriptionStatus, serializedAdditionalRawData); + return new HybridComputeProductFeatureUpdate(name, subscriptionStatus, serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(ProductFeatureUpdate)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(HybridComputeProductFeatureUpdate)} does not support writing '{options.Format}' format."); } } - ProductFeatureUpdate IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + HybridComputeProductFeatureUpdate IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeProductFeatureUpdate(document.RootElement, options); + return DeserializeHybridComputeProductFeatureUpdate(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ProductFeatureUpdate)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(HybridComputeProductFeatureUpdate)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ProductFeatureUpdate.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeProductFeatureUpdate.cs similarity index 82% rename from sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ProductFeatureUpdate.cs rename to sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeProductFeatureUpdate.cs index 5b65490daeae3..6b22cef557264 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ProductFeatureUpdate.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeProductFeatureUpdate.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.HybridCompute.Models { /// Product Feature. - public partial class ProductFeatureUpdate + public partial class HybridComputeProductFeatureUpdate { /// /// Keeps track of any properties unknown to the library. @@ -45,16 +45,16 @@ public partial class ProductFeatureUpdate /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public ProductFeatureUpdate() + /// Initializes a new instance of . + public HybridComputeProductFeatureUpdate() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Product feature name. /// Indicates the new status of the product feature. /// Keeps track of any properties unknown to the library. - internal ProductFeatureUpdate(string name, LicenseProfileSubscriptionStatusUpdate? subscriptionStatus, IDictionary serializedAdditionalRawData) + internal HybridComputeProductFeatureUpdate(string name, LicenseProfileSubscriptionStatusUpdate? subscriptionStatus, IDictionary serializedAdditionalRawData) { Name = name; SubscriptionStatus = subscriptionStatus; diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfilePatch.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfilePatch.Serialization.cs index 71cd28e866916..a8844d095c1f5 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfilePatch.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfilePatch.Serialization.cs @@ -102,7 +102,7 @@ internal static LicenseProfilePatch DeserializeLicenseProfilePatch(JsonElement e IDictionary tags = default; LicenseProfileSubscriptionStatusUpdate? subscriptionStatus = default; LicenseProfileProductType? productType = default; - IList productFeatures = default; + IList productFeatures = default; string assignedLicense = default; bool? softwareAssuranceCustomer = default; IDictionary serializedAdditionalRawData = default; @@ -165,10 +165,10 @@ internal static LicenseProfilePatch DeserializeLicenseProfilePatch(JsonElement e { continue; } - List array = new List(); + List array = new List(); foreach (var item in property1.Value.EnumerateArray()) { - array.Add(ProductFeatureUpdate.DeserializeProductFeatureUpdate(item, options)); + array.Add(HybridComputeProductFeatureUpdate.DeserializeHybridComputeProductFeatureUpdate(item, options)); } productFeatures = array; continue; @@ -228,7 +228,7 @@ internal static LicenseProfilePatch DeserializeLicenseProfilePatch(JsonElement e serializedAdditionalRawData, subscriptionStatus, productType, - productFeatures ?? new ChangeTrackingList(), + productFeatures ?? new ChangeTrackingList(), assignedLicense, softwareAssuranceCustomer); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfilePatch.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfilePatch.cs index 0160af1bf9591..377732bc75d68 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfilePatch.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfilePatch.cs @@ -16,7 +16,7 @@ public partial class LicenseProfilePatch : HybridComputeResourceUpdate /// Initializes a new instance of . public LicenseProfilePatch() { - ProductFeatures = new ChangeTrackingList(); + ProductFeatures = new ChangeTrackingList(); } /// Initializes a new instance of . @@ -27,7 +27,7 @@ public LicenseProfilePatch() /// The list of product feature updates. /// The resource id of the license. /// Specifies if this machine is licensed as part of a Software Assurance agreement. - internal LicenseProfilePatch(IDictionary tags, IDictionary serializedAdditionalRawData, LicenseProfileSubscriptionStatusUpdate? subscriptionStatus, LicenseProfileProductType? productType, IList productFeatures, string assignedLicense, bool? softwareAssuranceCustomer) : base(tags, serializedAdditionalRawData) + internal LicenseProfilePatch(IDictionary tags, IDictionary serializedAdditionalRawData, LicenseProfileSubscriptionStatusUpdate? subscriptionStatus, LicenseProfileProductType? productType, IList productFeatures, string assignedLicense, bool? softwareAssuranceCustomer) : base(tags, serializedAdditionalRawData) { SubscriptionStatus = subscriptionStatus; ProductType = productType; @@ -44,7 +44,7 @@ internal LicenseProfilePatch(IDictionary tags, IDictionary The list of product feature updates. [WirePath("properties.productFeatures")] - public IList ProductFeatures { get; } + public IList ProductFeatures { get; } /// The resource id of the license. [WirePath("properties.assignedLicense")] public string AssignedLicense { get; set; } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md index 49c2043691c63..2ed262648e699 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md @@ -68,6 +68,7 @@ prepend-rp-prefix: - Gateway - GatewayUpdate - GatewayType + - ProductFeatureUpdate list-exception: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{baseProvider}/{baseResourceType}/{baseResourceName}/providers/Microsoft.HybridCompute/settings/{settingsResourceName} @@ -108,6 +109,8 @@ rename-mapping: PatchSettingsStatus: HybridComputePatchSettingsStatus Settings: HybridComputeTargetResourceSettings OSProfileLinuxConfiguration.patchSettings.enableHotpatching: IsHotpatchingEnabled + LicenseProfileData: HybridComputeLicenseProfileData + LicenseProfilePatch: HybridComputeLicenseProfilePatch override-operation-name: Settings_Update: UpdateTargetResourceSetting From 9d67efce060117d4f681ae2a3b49b7ebd1886e8c Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Fri, 18 Oct 2024 12:03:15 +0800 Subject: [PATCH 13/14] update --- .../Azure.ResourceManager.HybridCompute/CHANGELOG.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/CHANGELOG.md b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/CHANGELOG.md index 57e163eadcd6d..f580a0b611cc0 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/CHANGELOG.md +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/CHANGELOG.md @@ -4,16 +4,16 @@ This is the first stable release of the Hybrid Compute library. -### Breaking Changes +### Features Added -- Upgraded api-version tag from 'package-preview-2024-05' to 'package-2024-07'. Tag detail available at https://github.com/Azure/azure-rest-api-specs/blob/15b16d1b5c3cccdecdd1cfe936f6a8005680c557/specification/hybridcompute/resource-manager/readme.md +- Upgraded api-version tag from 'package-preview-2024-05' to 'package-2024-07'. Tag detail available at https://github.com/Azure/azure-rest-api-specs/blob/15b16d1b5c3cccdecdd1cfe936f6a8005680c557/specification/hybridcompute/resource-manager/readme.md. +- Exposed `JsonModelWriteCore` for model serialization procedure. ## 1.0.0-beta.10 (2024-07-19) ### Features Added - Upgraded api-version tag from 'package-preview-2024-03' to 'package-preview-2024-05'. Tag detail available at https://github.com/Azure/azure-rest-api-specs/blob/b48d5d72073a296514d3d4db77887d8711526ccc/specification/hybridcompute/resource-manager/readme.md -- Added `ArmOperation.Rehydrate` and `ArmOperation.Rehydrate` static methods to rehydrate a long-running operation. - Added experimental Bicep serialization. ## 1.0.0-beta.9 (2024-06-07) From c951846b8d8ff8bb07a49ebfea2105d57a8ba772 Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Fri, 18 Oct 2024 12:34:34 +0800 Subject: [PATCH 14/14] update --- .../CHANGELOG.md | 2 +- ...rceManager.HybridCompute.netstandard2.0.cs | 144 +++++++------- ...le_HybridComputeLicenseProfileResource.cs} | 56 +++--- .../Generated/ArmHybridComputeModelFactory.cs | 8 +- .../Extensions/HybridComputeExtensions.cs | 12 +- .../MockableHybridComputeArmClient.cs | 12 +- ...omputeLicenseProfileData.Serialization.cs} | 38 ++-- ....cs => HybridComputeLicenseProfileData.cs} | 18 +- ...uteLicenseProfileResource.Serialization.cs | 26 +++ ...=> HybridComputeLicenseProfileResource.cs} | 186 +++++++++--------- .../Generated/HybridComputeMachineResource.cs | 8 +- .../LicenseProfileResource.Serialization.cs | 26 --- ...ridComputeLicenseProfileOperationSource.cs | 38 ++++ .../LicenseProfileOperationSource.cs | 38 ---- ...mputeLicenseProfilePatch.Serialization.cs} | 38 ++-- ...cs => HybridComputeLicenseProfilePatch.cs} | 10 +- ...LicenseProfilesListResult.Serialization.cs | 6 +- .../Models/LicenseProfilesListResult.cs | 6 +- .../LicenseProfilesRestOperations.cs | 32 +-- .../src/autorest.md | 14 +- 20 files changed, 354 insertions(+), 364 deletions(-) rename sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/{Sample_LicenseProfileResource.cs => Sample_HybridComputeLicenseProfileResource.cs} (65%) rename sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/{LicenseProfileData.Serialization.cs => HybridComputeLicenseProfileData.Serialization.cs} (94%) rename sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/{LicenseProfileData.cs => HybridComputeLicenseProfileData.cs} (83%) create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseProfileResource.Serialization.cs rename sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/{LicenseProfileResource.cs => HybridComputeLicenseProfileResource.cs} (69%) delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LicenseProfileResource.Serialization.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/HybridComputeLicenseProfileOperationSource.cs delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/LicenseProfileOperationSource.cs rename sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/{LicenseProfilePatch.Serialization.cs => HybridComputeLicenseProfilePatch.Serialization.cs} (83%) rename sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/{LicenseProfilePatch.cs => HybridComputeLicenseProfilePatch.cs} (75%) diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/CHANGELOG.md b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/CHANGELOG.md index f580a0b611cc0..4d67f9129c35b 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/CHANGELOG.md +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/CHANGELOG.md @@ -1,6 +1,6 @@ # Release History -## 1.0.0 (2024-10-13) +## 1.0.0 (2024-10-18) This is the first stable release of the Hybrid Compute library. diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/api/Azure.ResourceManager.HybridCompute.netstandard2.0.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/api/Azure.ResourceManager.HybridCompute.netstandard2.0.cs index d4c2672491b6c..a264619f6a21b 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/api/Azure.ResourceManager.HybridCompute.netstandard2.0.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/api/Azure.ResourceManager.HybridCompute.netstandard2.0.cs @@ -8,6 +8,7 @@ public static partial class HybridComputeExtensions public static Azure.ResourceManager.HybridCompute.HybridComputeExtensionValueCollection GetHybridComputeExtensionValues(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, string publisher, string extensionType) { throw null; } public static Azure.Response GetHybridComputeLicense(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string licenseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetHybridComputeLicenseAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string licenseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.HybridCompute.HybridComputeLicenseProfileResource GetHybridComputeLicenseProfileResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.HybridCompute.HybridComputeLicenseResource GetHybridComputeLicenseResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.HybridCompute.HybridComputeLicenseCollection GetHybridComputeLicenses(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetHybridComputeLicenses(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -27,7 +28,6 @@ public static partial class HybridComputeExtensions public static Azure.ResourceManager.HybridCompute.HybridComputePrivateLinkScopeCollection GetHybridComputePrivateLinkScopes(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetHybridComputePrivateLinkScopes(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetHybridComputePrivateLinkScopesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.ResourceManager.HybridCompute.LicenseProfileResource GetLicenseProfileResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.HybridCompute.NetworkSecurityPerimeterConfigurationResource GetNetworkSecurityPerimeterConfigurationResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Response GetValidationDetailsPrivateLinkScope(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, string privateLinkScopeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetValidationDetailsPrivateLinkScopeAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, string privateLinkScopeId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -108,6 +108,59 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class HybridComputeLicenseProfileData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HybridComputeLicenseProfileData(Azure.Core.AzureLocation location) { } + public string AssignedLicense { get { throw null; } set { } } + public System.Guid? AssignedLicenseImmutableId { get { throw null; } } + public System.DateTimeOffset? BillingEndOn { get { throw null; } } + public System.DateTimeOffset? BillingStartOn { get { throw null; } } + public System.DateTimeOffset? DisenrollmentOn { get { throw null; } } + public System.DateTimeOffset? EnrollmentOn { get { throw null; } } + public Azure.ResponseError Error { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.EsuEligibility? EsuEligibility { get { throw null; } } + public System.Collections.Generic.IReadOnlyList EsuKeys { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.EsuKeyState? EsuKeyState { get { throw null; } } + public System.Collections.Generic.IList ProductFeatures { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.LicenseProfileProductType? ProductType { get { throw null; } set { } } + public Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.EsuServerType? ServerType { get { throw null; } } + public bool? SoftwareAssuranceCustomer { get { throw null; } set { } } + public Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatus? SubscriptionStatus { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.HybridComputeLicenseProfileData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.HybridComputeLicenseProfileData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HybridComputeLicenseProfileResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected HybridComputeLicenseProfileResource() { } + public virtual Azure.ResourceManager.HybridCompute.HybridComputeLicenseProfileData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridCompute.HybridComputeLicenseProfileData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridCompute.HybridComputeLicenseProfileData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string machineName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.HybridCompute.HybridComputeLicenseProfileData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.HybridComputeLicenseProfileData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseProfilePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseProfilePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class HybridComputeLicenseResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public static readonly Azure.Core.ResourceType ResourceType; @@ -262,10 +315,10 @@ protected HybridComputeMachineResource() { } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(string expand = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(string expand = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.HybridCompute.HybridComputeLicenseProfileResource GetHybridComputeLicenseProfile() { throw null; } public virtual Azure.Response GetHybridComputeMachineExtension(string extensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetHybridComputeMachineExtensionAsync(string extensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.HybridCompute.HybridComputeMachineExtensionCollection GetHybridComputeMachineExtensions() { throw null; } - public virtual Azure.ResourceManager.HybridCompute.LicenseProfileResource GetLicenseProfile() { throw null; } public virtual Azure.Response GetNetworkProfile(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetNetworkProfileAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response GetValidationDetailsForMachinePrivateLinkScope(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -436,59 +489,6 @@ protected HybridComputePrivateLinkScopeResource() { } public virtual Azure.Response Update(Azure.ResourceManager.HybridCompute.Models.HybridComputePrivateLinkScopePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.ResourceManager.HybridCompute.Models.HybridComputePrivateLinkScopePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } - public partial class LicenseProfileData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public LicenseProfileData(Azure.Core.AzureLocation location) { } - public string AssignedLicense { get { throw null; } set { } } - public System.Guid? AssignedLicenseImmutableId { get { throw null; } } - public System.DateTimeOffset? BillingEndOn { get { throw null; } } - public System.DateTimeOffset? BillingStartOn { get { throw null; } } - public System.DateTimeOffset? DisenrollmentOn { get { throw null; } } - public System.DateTimeOffset? EnrollmentOn { get { throw null; } } - public Azure.ResponseError Error { get { throw null; } } - public Azure.ResourceManager.HybridCompute.Models.EsuEligibility? EsuEligibility { get { throw null; } } - public System.Collections.Generic.IReadOnlyList EsuKeys { get { throw null; } } - public Azure.ResourceManager.HybridCompute.Models.EsuKeyState? EsuKeyState { get { throw null; } } - public System.Collections.Generic.IList ProductFeatures { get { throw null; } } - public Azure.ResourceManager.HybridCompute.Models.LicenseProfileProductType? ProductType { get { throw null; } set { } } - public Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningState? ProvisioningState { get { throw null; } } - public Azure.ResourceManager.HybridCompute.Models.EsuServerType? ServerType { get { throw null; } } - public bool? SoftwareAssuranceCustomer { get { throw null; } set { } } - public Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatus? SubscriptionStatus { get { throw null; } set { } } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.HybridCompute.LicenseProfileData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.HybridCompute.LicenseProfileData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class LicenseProfileResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public static readonly Azure.Core.ResourceType ResourceType; - protected LicenseProfileResource() { } - public virtual Azure.ResourceManager.HybridCompute.LicenseProfileData Data { get { throw null; } } - public virtual bool HasData { get { throw null; } } - public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridCompute.LicenseProfileData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridCompute.LicenseProfileData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string machineName) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - Azure.ResourceManager.HybridCompute.LicenseProfileData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.HybridCompute.LicenseProfileData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridCompute.Models.LicenseProfilePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridCompute.Models.LicenseProfilePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - } public partial class NetworkSecurityPerimeterConfigurationCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected NetworkSecurityPerimeterConfigurationCollection() { } @@ -543,13 +543,13 @@ public partial class MockableHybridComputeArmClient : Azure.ResourceManager.ArmR { protected MockableHybridComputeArmClient() { } public virtual Azure.ResourceManager.HybridCompute.HybridComputeExtensionValueResource GetHybridComputeExtensionValueResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.HybridCompute.HybridComputeLicenseProfileResource GetHybridComputeLicenseProfileResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.HybridCompute.HybridComputeLicenseResource GetHybridComputeLicenseResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.HybridCompute.HybridComputeMachineExtensionResource GetHybridComputeMachineExtensionResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.HybridCompute.HybridComputeMachineResource GetHybridComputeMachineResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.HybridCompute.HybridComputePrivateEndpointConnectionResource GetHybridComputePrivateEndpointConnectionResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.HybridCompute.HybridComputePrivateLinkResource GetHybridComputePrivateLinkResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.HybridCompute.HybridComputePrivateLinkScopeResource GetHybridComputePrivateLinkScopeResource(Azure.Core.ResourceIdentifier id) { throw null; } - public virtual Azure.ResourceManager.HybridCompute.LicenseProfileResource GetLicenseProfileResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.HybridCompute.NetworkSecurityPerimeterConfigurationResource GetNetworkSecurityPerimeterConfigurationResource(Azure.Core.ResourceIdentifier id) { throw null; } } public partial class MockableHybridComputeResourceGroupResource : Azure.ResourceManager.ArmResource @@ -674,6 +674,7 @@ public static partial class ArmHybridComputeModelFactory public static Azure.ResourceManager.HybridCompute.Models.HybridComputeIPAddress HybridComputeIPAddress(string address = null, string ipAddressVersion = null, string subnetAddressPrefix = null) { throw null; } public static Azure.ResourceManager.HybridCompute.HybridComputeLicenseData HybridComputeLicenseData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningState? provisioningState = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningState?), System.Guid? tenantId = default(System.Guid?), Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseType? licenseType = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseType?), Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseDetails licenseDetails = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseDetails HybridComputeLicenseDetails(Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseState? state = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseState?), Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseTarget? target = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseTarget?), Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseEdition? edition = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseEdition?), Azure.ResourceManager.HybridCompute.Models.LicenseCoreType? licenseCoreType = default(Azure.ResourceManager.HybridCompute.Models.LicenseCoreType?), int? processors = default(int?), int? assignedLicenses = default(int?), string immutableId = null, System.Collections.Generic.IEnumerable volumeLicenseDetails = null) { throw null; } + public static Azure.ResourceManager.HybridCompute.HybridComputeLicenseProfileData HybridComputeLicenseProfileData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningState? provisioningState = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningState?), Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatus? subscriptionStatus = default(Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatus?), Azure.ResourceManager.HybridCompute.Models.LicenseProfileProductType? productType = default(Azure.ResourceManager.HybridCompute.Models.LicenseProfileProductType?), System.DateTimeOffset? enrollmentOn = default(System.DateTimeOffset?), System.DateTimeOffset? billingStartOn = default(System.DateTimeOffset?), System.DateTimeOffset? disenrollmentOn = default(System.DateTimeOffset?), System.DateTimeOffset? billingEndOn = default(System.DateTimeOffset?), Azure.ResponseError error = null, System.Collections.Generic.IEnumerable productFeatures = null, System.Guid? assignedLicenseImmutableId = default(System.Guid?), System.Collections.Generic.IEnumerable esuKeys = null, Azure.ResourceManager.HybridCompute.Models.EsuServerType? serverType = default(Azure.ResourceManager.HybridCompute.Models.EsuServerType?), Azure.ResourceManager.HybridCompute.Models.EsuEligibility? esuEligibility = default(Azure.ResourceManager.HybridCompute.Models.EsuEligibility?), Azure.ResourceManager.HybridCompute.Models.EsuKeyState? esuKeyState = default(Azure.ResourceManager.HybridCompute.Models.EsuKeyState?), string assignedLicense = null, bool? softwareAssuranceCustomer = default(bool?)) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputeLinuxConfiguration HybridComputeLinuxConfiguration(Azure.ResourceManager.HybridCompute.Models.AssessmentModeType? assessmentMode = default(Azure.ResourceManager.HybridCompute.Models.AssessmentModeType?), Azure.ResourceManager.HybridCompute.Models.PatchModeType? patchMode = default(Azure.ResourceManager.HybridCompute.Models.PatchModeType?), bool? isHotpatchingEnabled = default(bool?), Azure.ResourceManager.HybridCompute.Models.HybridComputePatchSettingsStatus status = null) { throw null; } public static Azure.ResourceManager.HybridCompute.HybridComputeMachineData HybridComputeMachineData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), System.Collections.Generic.IEnumerable resources = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.HybridCompute.Models.ArcKindEnum? kind = default(Azure.ResourceManager.HybridCompute.Models.ArcKindEnum?), Azure.ResourceManager.HybridCompute.Models.HybridComputeLocation locationData = null, Azure.ResourceManager.HybridCompute.Models.AgentConfiguration agentConfiguration = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeServiceStatuses serviceStatuses = null, string cloudMetadataProvider = null, Azure.ResourceManager.HybridCompute.Models.AgentUpgrade agentUpgrade = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeOSProfile osProfile = null, Azure.ResourceManager.HybridCompute.Models.LicenseProfileMachineInstanceView licenseProfile = null, string provisioningState = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeStatusType? status = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeStatusType?), System.DateTimeOffset? lastStatusChange = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable errorDetails = null, string agentVersion = null, System.Guid? vmId = default(System.Guid?), string displayName = null, string machineFqdn = null, string clientPublicKey = null, string osName = null, string osVersion = null, string osType = null, System.Guid? vmUuid = default(System.Guid?), System.Collections.Generic.IEnumerable extensions = null, string osSku = null, string osEdition = null, string domainName = null, string adFqdn = null, string dnsFqdn = null, Azure.Core.ResourceIdentifier privateLinkScopeResourceId = null, Azure.Core.ResourceIdentifier parentClusterResourceId = null, string msSqlDiscovered = null, System.Collections.Generic.IReadOnlyDictionary detectedProperties = null, System.Collections.Generic.IEnumerable networkInterfaces = null) { throw null; } public static Azure.ResourceManager.HybridCompute.HybridComputeMachineExtensionData HybridComputeMachineExtensionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.HybridCompute.Models.MachineExtensionProperties properties = null) { throw null; } @@ -693,7 +694,6 @@ public static partial class ArmHybridComputeModelFactory public static Azure.ResourceManager.HybridCompute.Models.HybridComputeResourceAssociation HybridComputeResourceAssociation(string name = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeAccessMode? accessMode = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeAccessMode?)) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputeWindowsConfiguration HybridComputeWindowsConfiguration(Azure.ResourceManager.HybridCompute.Models.AssessmentModeType? assessmentMode = default(Azure.ResourceManager.HybridCompute.Models.AssessmentModeType?), Azure.ResourceManager.HybridCompute.Models.PatchModeType? patchMode = default(Azure.ResourceManager.HybridCompute.Models.PatchModeType?), bool? isHotpatchingEnabled = default(bool?), Azure.ResourceManager.HybridCompute.Models.HybridComputePatchSettingsStatus status = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.LicenseProfileArmEsuPropertiesWithoutAssignedLicense LicenseProfileArmEsuPropertiesWithoutAssignedLicense(System.Guid? assignedLicenseImmutableId = default(System.Guid?), System.Collections.Generic.IEnumerable esuKeys = null, Azure.ResourceManager.HybridCompute.Models.EsuServerType? serverType = default(Azure.ResourceManager.HybridCompute.Models.EsuServerType?), Azure.ResourceManager.HybridCompute.Models.EsuEligibility? esuEligibility = default(Azure.ResourceManager.HybridCompute.Models.EsuEligibility?), Azure.ResourceManager.HybridCompute.Models.EsuKeyState? esuKeyState = default(Azure.ResourceManager.HybridCompute.Models.EsuKeyState?)) { throw null; } - public static Azure.ResourceManager.HybridCompute.LicenseProfileData LicenseProfileData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningState? provisioningState = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeProvisioningState?), Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatus? subscriptionStatus = default(Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatus?), Azure.ResourceManager.HybridCompute.Models.LicenseProfileProductType? productType = default(Azure.ResourceManager.HybridCompute.Models.LicenseProfileProductType?), System.DateTimeOffset? enrollmentOn = default(System.DateTimeOffset?), System.DateTimeOffset? billingStartOn = default(System.DateTimeOffset?), System.DateTimeOffset? disenrollmentOn = default(System.DateTimeOffset?), System.DateTimeOffset? billingEndOn = default(System.DateTimeOffset?), Azure.ResponseError error = null, System.Collections.Generic.IEnumerable productFeatures = null, System.Guid? assignedLicenseImmutableId = default(System.Guid?), System.Collections.Generic.IEnumerable esuKeys = null, Azure.ResourceManager.HybridCompute.Models.EsuServerType? serverType = default(Azure.ResourceManager.HybridCompute.Models.EsuServerType?), Azure.ResourceManager.HybridCompute.Models.EsuEligibility? esuEligibility = default(Azure.ResourceManager.HybridCompute.Models.EsuEligibility?), Azure.ResourceManager.HybridCompute.Models.EsuKeyState? esuKeyState = default(Azure.ResourceManager.HybridCompute.Models.EsuKeyState?), string assignedLicense = null, bool? softwareAssuranceCustomer = default(bool?)) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.LicenseProfileMachineInstanceView LicenseProfileMachineInstanceView(Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseStatus? licenseStatus = default(Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseStatus?), string licenseChannel = null, Azure.ResourceManager.HybridCompute.Models.LicenseProfileMachineInstanceViewEsuProperties esuProfile = null, Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatus? subscriptionStatus = default(Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatus?), Azure.ResourceManager.HybridCompute.Models.LicenseProfileProductType? productType = default(Azure.ResourceManager.HybridCompute.Models.LicenseProfileProductType?), System.DateTimeOffset? enrollmentOn = default(System.DateTimeOffset?), System.DateTimeOffset? billingStartOn = default(System.DateTimeOffset?), System.DateTimeOffset? disenrollmentOn = default(System.DateTimeOffset?), System.DateTimeOffset? billingEndOn = default(System.DateTimeOffset?), Azure.ResponseError error = null, System.Collections.Generic.IEnumerable productFeatures = null, bool? isSoftwareAssuranceCustomer = default(bool?)) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.LicenseProfileMachineInstanceViewEsuProperties LicenseProfileMachineInstanceViewEsuProperties(System.Guid? assignedLicenseImmutableId = default(System.Guid?), System.Collections.Generic.IEnumerable esuKeys = null, Azure.ResourceManager.HybridCompute.Models.EsuServerType? serverType = default(Azure.ResourceManager.HybridCompute.Models.EsuServerType?), Azure.ResourceManager.HybridCompute.Models.EsuEligibility? esuEligibility = default(Azure.ResourceManager.HybridCompute.Models.EsuEligibility?), Azure.ResourceManager.HybridCompute.Models.EsuKeyState? esuKeyState = default(Azure.ResourceManager.HybridCompute.Models.EsuKeyState?), Azure.ResourceManager.HybridCompute.HybridComputeLicenseData assignedLicense = null, Azure.ResourceManager.HybridCompute.Models.LicenseAssignmentState? licenseAssignmentState = default(Azure.ResourceManager.HybridCompute.Models.LicenseAssignmentState?)) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.LicenseProfileStorageModelEsuProperties LicenseProfileStorageModelEsuProperties(System.Guid? assignedLicenseImmutableId = default(System.Guid?), System.Collections.Generic.IEnumerable esuKeys = null) { throw null; } @@ -970,6 +970,21 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseEdition left, Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseEdition right) { throw null; } public override string ToString() { throw null; } } + public partial class HybridComputeLicenseProfilePatch : Azure.ResourceManager.HybridCompute.Models.HybridComputeResourceUpdate, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HybridComputeLicenseProfilePatch() { } + public string AssignedLicense { get { throw null; } set { } } + public System.Collections.Generic.IList ProductFeatures { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.LicenseProfileProductType? ProductType { get { throw null; } set { } } + public bool? SoftwareAssuranceCustomer { get { throw null; } set { } } + public Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatusUpdate? SubscriptionStatus { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseProfilePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseProfilePatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct HybridComputeLicenseState : System.IEquatable { @@ -1613,21 +1628,6 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class LicenseProfilePatch : Azure.ResourceManager.HybridCompute.Models.HybridComputeResourceUpdate, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public LicenseProfilePatch() { } - public string AssignedLicense { get { throw null; } set { } } - public System.Collections.Generic.IList ProductFeatures { get { throw null; } } - public Azure.ResourceManager.HybridCompute.Models.LicenseProfileProductType? ProductType { get { throw null; } set { } } - public bool? SoftwareAssuranceCustomer { get { throw null; } set { } } - public Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatusUpdate? SubscriptionStatus { get { throw null; } set { } } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.HybridCompute.Models.LicenseProfilePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.HybridCompute.Models.LicenseProfilePatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct LicenseProfileProductType : System.IEquatable { diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_LicenseProfileResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeLicenseProfileResource.cs similarity index 65% rename from sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_LicenseProfileResource.cs rename to sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeLicenseProfileResource.cs index ccc84edeade5b..56b22593ec0c9 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_LicenseProfileResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeLicenseProfileResource.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.HybridCompute.Samples { - public partial class Sample_LicenseProfileResource + public partial class Sample_HybridComputeLicenseProfileResource { // Create or Update a License Profile [NUnit.Framework.Test] @@ -28,16 +28,16 @@ public async Task CreateOrUpdate_CreateOrUpdateALicenseProfile() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this LicenseProfileResource created on azure - // for more information of creating LicenseProfileResource, please refer to the document of LicenseProfileResource + // this example assumes you already have this HybridComputeLicenseProfileResource created on azure + // for more information of creating HybridComputeLicenseProfileResource, please refer to the document of HybridComputeLicenseProfileResource string subscriptionId = "{subscriptionId}"; string resourceGroupName = "myResourceGroup"; string machineName = "myMachine"; - ResourceIdentifier licenseProfileResourceId = LicenseProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, machineName); - LicenseProfileResource licenseProfile = client.GetLicenseProfileResource(licenseProfileResourceId); + ResourceIdentifier hybridComputeLicenseProfileResourceId = HybridComputeLicenseProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, machineName); + HybridComputeLicenseProfileResource hybridComputeLicenseProfile = client.GetHybridComputeLicenseProfileResource(hybridComputeLicenseProfileResourceId); // invoke the operation - LicenseProfileData data = new LicenseProfileData(new AzureLocation("eastus2euap")) + HybridComputeLicenseProfileData data = new HybridComputeLicenseProfileData(new AzureLocation("eastus2euap")) { SubscriptionStatus = LicenseProfileSubscriptionStatus.Enabled, ProductType = LicenseProfileProductType.WindowsServer, @@ -52,12 +52,12 @@ public async Task CreateOrUpdate_CreateOrUpdateALicenseProfile() AssignedLicense = "{LicenseResourceId}", SoftwareAssuranceCustomer = true, }; - ArmOperation lro = await licenseProfile.CreateOrUpdateAsync(WaitUntil.Completed, data); - LicenseProfileResource result = lro.Value; + ArmOperation lro = await hybridComputeLicenseProfile.CreateOrUpdateAsync(WaitUntil.Completed, data); + HybridComputeLicenseProfileResource 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 - LicenseProfileData resourceData = result.Data; + HybridComputeLicenseProfileData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -75,16 +75,16 @@ public async Task Update_UpdateALicenseProfile() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this LicenseProfileResource created on azure - // for more information of creating LicenseProfileResource, please refer to the document of LicenseProfileResource + // this example assumes you already have this HybridComputeLicenseProfileResource created on azure + // for more information of creating HybridComputeLicenseProfileResource, please refer to the document of HybridComputeLicenseProfileResource string subscriptionId = "{subscriptionId}"; string resourceGroupName = "myResourceGroup"; string machineName = "myMachine"; - ResourceIdentifier licenseProfileResourceId = LicenseProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, machineName); - LicenseProfileResource licenseProfile = client.GetLicenseProfileResource(licenseProfileResourceId); + ResourceIdentifier hybridComputeLicenseProfileResourceId = HybridComputeLicenseProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, machineName); + HybridComputeLicenseProfileResource hybridComputeLicenseProfile = client.GetHybridComputeLicenseProfileResource(hybridComputeLicenseProfileResourceId); // invoke the operation - LicenseProfilePatch patch = new LicenseProfilePatch() + HybridComputeLicenseProfilePatch patch = new HybridComputeLicenseProfilePatch() { SubscriptionStatus = LicenseProfileSubscriptionStatusUpdate.Enable, ProductType = LicenseProfileProductType.WindowsServer, @@ -99,12 +99,12 @@ public async Task Update_UpdateALicenseProfile() AssignedLicense = "{LicenseResourceId}", SoftwareAssuranceCustomer = true, }; - ArmOperation lro = await licenseProfile.UpdateAsync(WaitUntil.Completed, patch); - LicenseProfileResource result = lro.Value; + ArmOperation lro = await hybridComputeLicenseProfile.UpdateAsync(WaitUntil.Completed, patch); + HybridComputeLicenseProfileResource 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 - LicenseProfileData resourceData = result.Data; + HybridComputeLicenseProfileData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -122,20 +122,20 @@ public async Task Get_GetLicenseProfile() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this LicenseProfileResource created on azure - // for more information of creating LicenseProfileResource, please refer to the document of LicenseProfileResource + // this example assumes you already have this HybridComputeLicenseProfileResource created on azure + // for more information of creating HybridComputeLicenseProfileResource, please refer to the document of HybridComputeLicenseProfileResource string subscriptionId = "{subscriptionId}"; string resourceGroupName = "myResourceGroup"; string machineName = "myMachine"; - ResourceIdentifier licenseProfileResourceId = LicenseProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, machineName); - LicenseProfileResource licenseProfile = client.GetLicenseProfileResource(licenseProfileResourceId); + ResourceIdentifier hybridComputeLicenseProfileResourceId = HybridComputeLicenseProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, machineName); + HybridComputeLicenseProfileResource hybridComputeLicenseProfile = client.GetHybridComputeLicenseProfileResource(hybridComputeLicenseProfileResourceId); // invoke the operation - LicenseProfileResource result = await licenseProfile.GetAsync(); + HybridComputeLicenseProfileResource result = await hybridComputeLicenseProfile.GetAsync(); // the variable result is a resource, you could call other operations on this instance as well // but just for demo, we get its data from this resource instance - LicenseProfileData resourceData = result.Data; + HybridComputeLicenseProfileData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -153,16 +153,16 @@ public async Task Delete_DeleteALicenseProfile() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this LicenseProfileResource created on azure - // for more information of creating LicenseProfileResource, please refer to the document of LicenseProfileResource + // this example assumes you already have this HybridComputeLicenseProfileResource created on azure + // for more information of creating HybridComputeLicenseProfileResource, please refer to the document of HybridComputeLicenseProfileResource string subscriptionId = "{subscriptionId}"; string resourceGroupName = "myResourceGroup"; string machineName = "myMachine"; - ResourceIdentifier licenseProfileResourceId = LicenseProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, machineName); - LicenseProfileResource licenseProfile = client.GetLicenseProfileResource(licenseProfileResourceId); + ResourceIdentifier hybridComputeLicenseProfileResourceId = HybridComputeLicenseProfileResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, machineName); + HybridComputeLicenseProfileResource hybridComputeLicenseProfile = client.GetHybridComputeLicenseProfileResource(hybridComputeLicenseProfileResourceId); // invoke the operation - await licenseProfile.DeleteAsync(WaitUntil.Completed); + await hybridComputeLicenseProfile.DeleteAsync(WaitUntil.Completed); Console.WriteLine($"Succeeded"); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArmHybridComputeModelFactory.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArmHybridComputeModelFactory.cs index baa47328f4bc6..d7776820c59c5 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArmHybridComputeModelFactory.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArmHybridComputeModelFactory.cs @@ -473,7 +473,7 @@ public static MachineExtensionProperties MachineExtensionProperties(string force serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -496,14 +496,14 @@ public static MachineExtensionProperties MachineExtensionProperties(string force /// Indicates whether there is an ESU Key currently active for the machine. /// The resource id of the license. /// Specifies if this machine is licensed as part of a Software Assurance agreement. - /// A new instance for mocking. - public static LicenseProfileData LicenseProfileData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, HybridComputeProvisioningState? provisioningState = null, LicenseProfileSubscriptionStatus? subscriptionStatus = null, LicenseProfileProductType? productType = null, DateTimeOffset? enrollmentOn = null, DateTimeOffset? billingStartOn = null, DateTimeOffset? disenrollmentOn = null, DateTimeOffset? billingEndOn = null, ResponseError error = null, IEnumerable productFeatures = null, Guid? assignedLicenseImmutableId = null, IEnumerable esuKeys = null, EsuServerType? serverType = null, EsuEligibility? esuEligibility = null, EsuKeyState? esuKeyState = null, string assignedLicense = null, bool? softwareAssuranceCustomer = null) + /// A new instance for mocking. + public static HybridComputeLicenseProfileData HybridComputeLicenseProfileData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, HybridComputeProvisioningState? provisioningState = null, LicenseProfileSubscriptionStatus? subscriptionStatus = null, LicenseProfileProductType? productType = null, DateTimeOffset? enrollmentOn = null, DateTimeOffset? billingStartOn = null, DateTimeOffset? disenrollmentOn = null, DateTimeOffset? billingEndOn = null, ResponseError error = null, IEnumerable productFeatures = null, Guid? assignedLicenseImmutableId = null, IEnumerable esuKeys = null, EsuServerType? serverType = null, EsuEligibility? esuEligibility = null, EsuKeyState? esuKeyState = null, string assignedLicense = null, bool? softwareAssuranceCustomer = null) { tags ??= new Dictionary(); productFeatures ??= new List(); esuKeys ??= new List(); - return new LicenseProfileData( + return new HybridComputeLicenseProfileData( id, name, resourceType, diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/HybridComputeExtensions.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/HybridComputeExtensions.cs index 25563806cb0e1..38fd0b7b76290 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/HybridComputeExtensions.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/HybridComputeExtensions.cs @@ -72,22 +72,22 @@ public static HybridComputeMachineResource GetHybridComputeMachineResource(this } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static LicenseProfileResource GetLicenseProfileResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static HybridComputeLicenseProfileResource GetHybridComputeLicenseProfileResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableHybridComputeArmClient(client).GetLicenseProfileResource(id); + return GetMockableHybridComputeArmClient(client).GetHybridComputeLicenseProfileResource(id); } /// diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeArmClient.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeArmClient.cs index cc5eb1671025c..317c7b7485b92 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeArmClient.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeArmClient.cs @@ -59,15 +59,15 @@ public virtual HybridComputeMachineResource GetHybridComputeMachineResource(Reso } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// The resource ID of the resource to get. - /// Returns a object. - public virtual LicenseProfileResource GetLicenseProfileResource(ResourceIdentifier id) + /// Returns a object. + public virtual HybridComputeLicenseProfileResource GetHybridComputeLicenseProfileResource(ResourceIdentifier id) { - LicenseProfileResource.ValidateResourceId(id); - return new LicenseProfileResource(Client, id); + HybridComputeLicenseProfileResource.ValidateResourceId(id); + return new HybridComputeLicenseProfileResource(Client, id); } /// diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LicenseProfileData.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseProfileData.Serialization.cs similarity index 94% rename from sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LicenseProfileData.Serialization.cs rename to sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseProfileData.Serialization.cs index 36cb1f2e824a7..c0ffc6e4996de 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LicenseProfileData.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseProfileData.Serialization.cs @@ -17,11 +17,11 @@ namespace Azure.ResourceManager.HybridCompute { - public partial class LicenseProfileData : IUtf8JsonSerializable, IJsonModel + public partial class HybridComputeLicenseProfileData : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -32,10 +32,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LicenseProfileData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(HybridComputeLicenseProfileData)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); @@ -143,19 +143,19 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WriteEndObject(); } - LicenseProfileData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + HybridComputeLicenseProfileData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LicenseProfileData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(HybridComputeLicenseProfileData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeLicenseProfileData(document.RootElement, options); + return DeserializeHybridComputeLicenseProfileData(document.RootElement, options); } - internal static LicenseProfileData DeserializeLicenseProfileData(JsonElement element, ModelReaderWriterOptions options = null) + internal static HybridComputeLicenseProfileData DeserializeHybridComputeLicenseProfileData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -436,7 +436,7 @@ internal static LicenseProfileData DeserializeLicenseProfileData(JsonElement ele } } serializedAdditionalRawData = rawDataDictionary; - return new LicenseProfileData( + return new HybridComputeLicenseProfileData( id, name, type, @@ -860,9 +860,9 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) return BinaryData.FromString(builder.ToString()); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { @@ -871,26 +871,26 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions case "bicep": return SerializeBicep(options); default: - throw new FormatException($"The model {nameof(LicenseProfileData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(HybridComputeLicenseProfileData)} does not support writing '{options.Format}' format."); } } - LicenseProfileData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + HybridComputeLicenseProfileData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeLicenseProfileData(document.RootElement, options); + return DeserializeHybridComputeLicenseProfileData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(LicenseProfileData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(HybridComputeLicenseProfileData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LicenseProfileData.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseProfileData.cs similarity index 83% rename from sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LicenseProfileData.cs rename to sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseProfileData.cs index 5f81b02ff8ef2..bc9a62c2a8aaa 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LicenseProfileData.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseProfileData.cs @@ -14,10 +14,10 @@ namespace Azure.ResourceManager.HybridCompute { /// - /// A class representing the LicenseProfile data model. + /// A class representing the HybridComputeLicenseProfile data model. /// Describes a license profile in a hybrid machine. /// - public partial class LicenseProfileData : TrackedResourceData + public partial class HybridComputeLicenseProfileData : TrackedResourceData { /// /// Keeps track of any properties unknown to the library. @@ -51,15 +51,15 @@ public partial class LicenseProfileData : TrackedResourceData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The location. - public LicenseProfileData(AzureLocation location) : base(location) + public HybridComputeLicenseProfileData(AzureLocation location) : base(location) { ProductFeatures = new ChangeTrackingList(); EsuKeys = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -83,7 +83,7 @@ public LicenseProfileData(AzureLocation location) : base(location) /// The resource id of the license. /// Specifies if this machine is licensed as part of a Software Assurance agreement. /// Keeps track of any properties unknown to the library. - internal LicenseProfileData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, HybridComputeProvisioningState? provisioningState, LicenseProfileSubscriptionStatus? subscriptionStatus, LicenseProfileProductType? productType, DateTimeOffset? enrollmentOn, DateTimeOffset? billingStartOn, DateTimeOffset? disenrollmentOn, DateTimeOffset? billingEndOn, ResponseError error, IList productFeatures, Guid? assignedLicenseImmutableId, IReadOnlyList esuKeys, EsuServerType? serverType, EsuEligibility? esuEligibility, EsuKeyState? esuKeyState, string assignedLicense, bool? softwareAssuranceCustomer, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal HybridComputeLicenseProfileData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, HybridComputeProvisioningState? provisioningState, LicenseProfileSubscriptionStatus? subscriptionStatus, LicenseProfileProductType? productType, DateTimeOffset? enrollmentOn, DateTimeOffset? billingStartOn, DateTimeOffset? disenrollmentOn, DateTimeOffset? billingEndOn, ResponseError error, IList productFeatures, Guid? assignedLicenseImmutableId, IReadOnlyList esuKeys, EsuServerType? serverType, EsuEligibility? esuEligibility, EsuKeyState? esuKeyState, string assignedLicense, bool? softwareAssuranceCustomer, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { ProvisioningState = provisioningState; SubscriptionStatus = subscriptionStatus; @@ -104,8 +104,8 @@ internal LicenseProfileData(ResourceIdentifier id, string name, ResourceType res _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal LicenseProfileData() + /// Initializes a new instance of for deserialization. + internal HybridComputeLicenseProfileData() { } @@ -156,6 +156,6 @@ internal LicenseProfileData() public string AssignedLicense { get; set; } /// Specifies if this machine is licensed as part of a Software Assurance agreement. [WirePath("properties.softwareAssuranceCustomer")] - public bool? IsSoftwareAssuranceCustomer { get; set; } + public bool? SoftwareAssuranceCustomer { get; set; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseProfileResource.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseProfileResource.Serialization.cs new file mode 100644 index 0000000000000..7e19e9b0ca899 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseProfileResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.HybridCompute +{ + public partial class HybridComputeLicenseProfileResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + HybridComputeLicenseProfileData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + HybridComputeLicenseProfileData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LicenseProfileResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseProfileResource.cs similarity index 69% rename from sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LicenseProfileResource.cs rename to sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseProfileResource.cs index 662d8a247b8af..954cf8f5c364d 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LicenseProfileResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseProfileResource.cs @@ -17,14 +17,14 @@ namespace Azure.ResourceManager.HybridCompute { /// - /// A Class representing a LicenseProfile along with the instance operations that can be performed on it. - /// If you have a you can construct a - /// from an instance of using the GetLicenseProfileResource method. - /// Otherwise you can get one from its parent resource using the GetLicenseProfile method. + /// A Class representing a HybridComputeLicenseProfile along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetHybridComputeLicenseProfileResource method. + /// Otherwise you can get one from its parent resource using the GetHybridComputeLicenseProfile method. /// - public partial class LicenseProfileResource : ArmResource + public partial class HybridComputeLicenseProfileResource : ArmResource { - /// Generate the resource identifier of a instance. + /// Generate the resource identifier of a instance. /// The subscriptionId. /// The resourceGroupName. /// The machineName. @@ -34,35 +34,35 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _licenseProfileClientDiagnostics; - private readonly LicenseProfilesRestOperations _licenseProfileRestClient; - private readonly LicenseProfileData _data; + private readonly ClientDiagnostics _hybridComputeLicenseProfileLicenseProfilesClientDiagnostics; + private readonly LicenseProfilesRestOperations _hybridComputeLicenseProfileLicenseProfilesRestClient; + private readonly HybridComputeLicenseProfileData _data; /// Gets the resource type for the operations. public static readonly ResourceType ResourceType = "Microsoft.HybridCompute/machines/licenseProfiles"; - /// Initializes a new instance of the class for mocking. - protected LicenseProfileResource() + /// Initializes a new instance of the class for mocking. + protected HybridComputeLicenseProfileResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The resource that is the target of operations. - internal LicenseProfileResource(ArmClient client, LicenseProfileData data) : this(client, data.Id) + internal HybridComputeLicenseProfileResource(ArmClient client, HybridComputeLicenseProfileData data) : this(client, data.Id) { HasData = true; _data = data; } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The identifier of the resource that is the target of operations. - internal LicenseProfileResource(ArmClient client, ResourceIdentifier id) : base(client, id) + internal HybridComputeLicenseProfileResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _licenseProfileClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridCompute", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string licenseProfileApiVersion); - _licenseProfileRestClient = new LicenseProfilesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, licenseProfileApiVersion); + _hybridComputeLicenseProfileLicenseProfilesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridCompute", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string hybridComputeLicenseProfileLicenseProfilesApiVersion); + _hybridComputeLicenseProfileLicenseProfilesRestClient = new LicenseProfilesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, hybridComputeLicenseProfileLicenseProfilesApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -73,7 +73,7 @@ internal LicenseProfileResource(ArmClient client, ResourceIdentifier id) : base( /// Gets the data representing this Feature. /// Throws if there is no data loaded in the current instance. - public virtual LicenseProfileData Data + public virtual HybridComputeLicenseProfileData Data { get { @@ -106,21 +106,21 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _licenseProfileClientDiagnostics.CreateScope("LicenseProfileResource.Get"); + using var scope = _hybridComputeLicenseProfileLicenseProfilesClientDiagnostics.CreateScope("HybridComputeLicenseProfileResource.Get"); scope.Start(); try { - var response = await _licenseProfileRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken).ConfigureAwait(false); + var response = await _hybridComputeLicenseProfileLicenseProfilesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new LicenseProfileResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new HybridComputeLicenseProfileResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -146,21 +146,21 @@ public virtual async Task> GetAsync(Cancellatio /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) + public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _licenseProfileClientDiagnostics.CreateScope("LicenseProfileResource.Get"); + using var scope = _hybridComputeLicenseProfileLicenseProfilesClientDiagnostics.CreateScope("HybridComputeLicenseProfileResource.Get"); scope.Start(); try { - var response = _licenseProfileRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken); + var response = _hybridComputeLicenseProfileLicenseProfilesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new LicenseProfileResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new HybridComputeLicenseProfileResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -186,7 +186,7 @@ public virtual Response Get(CancellationToken cancellati /// /// /// Resource - /// + /// /// /// /// @@ -194,12 +194,12 @@ public virtual Response Get(CancellationToken cancellati /// The cancellation token to use. public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _licenseProfileClientDiagnostics.CreateScope("LicenseProfileResource.Delete"); + using var scope = _hybridComputeLicenseProfileLicenseProfilesClientDiagnostics.CreateScope("HybridComputeLicenseProfileResource.Delete"); scope.Start(); try { - var response = await _licenseProfileRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken).ConfigureAwait(false); - var operation = new HybridComputeArmOperation(_licenseProfileClientDiagnostics, Pipeline, _licenseProfileRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name).Request, response, OperationFinalStateVia.Location); + var response = await _hybridComputeLicenseProfileLicenseProfilesRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken).ConfigureAwait(false); + var operation = new HybridComputeArmOperation(_hybridComputeLicenseProfileLicenseProfilesClientDiagnostics, Pipeline, _hybridComputeLicenseProfileLicenseProfilesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -228,7 +228,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Resource - /// + /// /// /// /// @@ -236,12 +236,12 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// The cancellation token to use. public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _licenseProfileClientDiagnostics.CreateScope("LicenseProfileResource.Delete"); + using var scope = _hybridComputeLicenseProfileLicenseProfilesClientDiagnostics.CreateScope("HybridComputeLicenseProfileResource.Delete"); scope.Start(); try { - var response = _licenseProfileRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken); - var operation = new HybridComputeArmOperation(_licenseProfileClientDiagnostics, Pipeline, _licenseProfileRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name).Request, response, OperationFinalStateVia.Location); + var response = _hybridComputeLicenseProfileLicenseProfilesRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken); + var operation = new HybridComputeArmOperation(_hybridComputeLicenseProfileLicenseProfilesClientDiagnostics, Pipeline, _hybridComputeLicenseProfileLicenseProfilesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -270,7 +270,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Resource - /// + /// /// /// /// @@ -278,16 +278,16 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// Parameters supplied to the Update license profile operation. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, LicenseProfilePatch patch, CancellationToken cancellationToken = default) + public virtual async Task> UpdateAsync(WaitUntil waitUntil, HybridComputeLicenseProfilePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(patch, nameof(patch)); - using var scope = _licenseProfileClientDiagnostics.CreateScope("LicenseProfileResource.Update"); + using var scope = _hybridComputeLicenseProfileLicenseProfilesClientDiagnostics.CreateScope("HybridComputeLicenseProfileResource.Update"); scope.Start(); try { - var response = await _licenseProfileRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new HybridComputeArmOperation(new LicenseProfileOperationSource(Client), _licenseProfileClientDiagnostics, Pipeline, _licenseProfileRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = await _hybridComputeLicenseProfileLicenseProfilesRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new HybridComputeArmOperation(new HybridComputeLicenseProfileOperationSource(Client), _hybridComputeLicenseProfileLicenseProfilesClientDiagnostics, Pipeline, _hybridComputeLicenseProfileLicenseProfilesRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, patch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -316,7 +316,7 @@ public virtual async Task> UpdateAsync(Wait /// /// /// Resource - /// + /// /// /// /// @@ -324,16 +324,16 @@ public virtual async Task> UpdateAsync(Wait /// Parameters supplied to the Update license profile operation. /// The cancellation token to use. /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, LicenseProfilePatch patch, CancellationToken cancellationToken = default) + public virtual ArmOperation Update(WaitUntil waitUntil, HybridComputeLicenseProfilePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(patch, nameof(patch)); - using var scope = _licenseProfileClientDiagnostics.CreateScope("LicenseProfileResource.Update"); + using var scope = _hybridComputeLicenseProfileLicenseProfilesClientDiagnostics.CreateScope("HybridComputeLicenseProfileResource.Update"); scope.Start(); try { - var response = _licenseProfileRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, patch, cancellationToken); - var operation = new HybridComputeArmOperation(new LicenseProfileOperationSource(Client), _licenseProfileClientDiagnostics, Pipeline, _licenseProfileRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = _hybridComputeLicenseProfileLicenseProfilesRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, patch, cancellationToken); + var operation = new HybridComputeArmOperation(new HybridComputeLicenseProfileOperationSource(Client), _hybridComputeLicenseProfileLicenseProfilesClientDiagnostics, Pipeline, _hybridComputeLicenseProfileLicenseProfilesRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, patch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -362,7 +362,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, /// /// /// Resource - /// + /// /// /// /// @@ -370,16 +370,16 @@ public virtual ArmOperation Update(WaitUntil waitUntil, /// Parameters supplied to the Create or Update license profile operation. /// The cancellation token to use. /// is null. - public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, LicenseProfileData data, CancellationToken cancellationToken = default) + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, HybridComputeLicenseProfileData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _licenseProfileClientDiagnostics.CreateScope("LicenseProfileResource.CreateOrUpdate"); + using var scope = _hybridComputeLicenseProfileLicenseProfilesClientDiagnostics.CreateScope("HybridComputeLicenseProfileResource.CreateOrUpdate"); scope.Start(); try { - var response = await _licenseProfileRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new HybridComputeArmOperation(new LicenseProfileOperationSource(Client), _licenseProfileClientDiagnostics, Pipeline, _licenseProfileRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, data).Request, response, OperationFinalStateVia.Location); + var response = await _hybridComputeLicenseProfileLicenseProfilesRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new HybridComputeArmOperation(new HybridComputeLicenseProfileOperationSource(Client), _hybridComputeLicenseProfileLicenseProfilesClientDiagnostics, Pipeline, _hybridComputeLicenseProfileLicenseProfilesRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -408,7 +408,7 @@ public virtual async Task> CreateOrUpdateAs /// /// /// Resource - /// + /// /// /// /// @@ -416,16 +416,16 @@ public virtual async Task> CreateOrUpdateAs /// Parameters supplied to the Create or Update license profile operation. /// The cancellation token to use. /// is null. - public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, LicenseProfileData data, CancellationToken cancellationToken = default) + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, HybridComputeLicenseProfileData data, CancellationToken cancellationToken = default) { Argument.AssertNotNull(data, nameof(data)); - using var scope = _licenseProfileClientDiagnostics.CreateScope("LicenseProfileResource.CreateOrUpdate"); + using var scope = _hybridComputeLicenseProfileLicenseProfilesClientDiagnostics.CreateScope("HybridComputeLicenseProfileResource.CreateOrUpdate"); scope.Start(); try { - var response = _licenseProfileRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, data, cancellationToken); - var operation = new HybridComputeArmOperation(new LicenseProfileOperationSource(Client), _licenseProfileClientDiagnostics, Pipeline, _licenseProfileRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, data).Request, response, OperationFinalStateVia.Location); + var response = _hybridComputeLicenseProfileLicenseProfilesRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, data, cancellationToken); + var operation = new HybridComputeArmOperation(new HybridComputeLicenseProfileOperationSource(Client), _hybridComputeLicenseProfileLicenseProfilesClientDiagnostics, Pipeline, _hybridComputeLicenseProfileLicenseProfilesRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -454,7 +454,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wai /// /// /// Resource - /// + /// /// /// /// @@ -462,12 +462,12 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wai /// The value for the tag. /// The cancellation token to use. /// or is null. - public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _licenseProfileClientDiagnostics.CreateScope("LicenseProfileResource.AddTag"); + using var scope = _hybridComputeLicenseProfileLicenseProfilesClientDiagnostics.CreateScope("HybridComputeLicenseProfileResource.AddTag"); scope.Start(); try { @@ -476,13 +476,13 @@ public virtual async Task> AddTagAsync(string k var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues[key] = value; await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _licenseProfileRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new LicenseProfileResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _hybridComputeLicenseProfileLicenseProfilesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new HybridComputeLicenseProfileResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new LicenseProfilePatch(); + var patch = new HybridComputeLicenseProfilePatch(); foreach (var tag in current.Tags) { patch.Tags.Add(tag); @@ -516,7 +516,7 @@ public virtual async Task> AddTagAsync(string k /// /// /// Resource - /// + /// /// /// /// @@ -524,12 +524,12 @@ public virtual async Task> AddTagAsync(string k /// The value for the tag. /// The cancellation token to use. /// or is null. - public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _licenseProfileClientDiagnostics.CreateScope("LicenseProfileResource.AddTag"); + using var scope = _hybridComputeLicenseProfileLicenseProfilesClientDiagnostics.CreateScope("HybridComputeLicenseProfileResource.AddTag"); scope.Start(); try { @@ -538,13 +538,13 @@ public virtual Response AddTag(string key, string value, var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues[key] = value; GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _licenseProfileRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken); - return Response.FromValue(new LicenseProfileResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = _hybridComputeLicenseProfileLicenseProfilesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken); + return Response.FromValue(new HybridComputeLicenseProfileResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new LicenseProfilePatch(); + var patch = new HybridComputeLicenseProfilePatch(); foreach (var tag in current.Tags) { patch.Tags.Add(tag); @@ -578,18 +578,18 @@ public virtual Response AddTag(string key, string value, /// /// /// Resource - /// + /// /// /// /// /// The set of tags to use as replacement. /// The cancellation token to use. /// is null. - public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _licenseProfileClientDiagnostics.CreateScope("LicenseProfileResource.SetTags"); + using var scope = _hybridComputeLicenseProfileLicenseProfilesClientDiagnostics.CreateScope("HybridComputeLicenseProfileResource.SetTags"); scope.Start(); try { @@ -599,13 +599,13 @@ public virtual async Task> SetTagsAsync(IDictio var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.ReplaceWith(tags); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _licenseProfileRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new LicenseProfileResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _hybridComputeLicenseProfileLicenseProfilesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new HybridComputeLicenseProfileResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new LicenseProfilePatch(); + var patch = new HybridComputeLicenseProfilePatch(); patch.Tags.ReplaceWith(tags); var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(result.Value, result.GetRawResponse()); @@ -635,18 +635,18 @@ public virtual async Task> SetTagsAsync(IDictio /// /// /// Resource - /// + /// /// /// /// /// The set of tags to use as replacement. /// The cancellation token to use. /// is null. - public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _licenseProfileClientDiagnostics.CreateScope("LicenseProfileResource.SetTags"); + using var scope = _hybridComputeLicenseProfileLicenseProfilesClientDiagnostics.CreateScope("HybridComputeLicenseProfileResource.SetTags"); scope.Start(); try { @@ -656,13 +656,13 @@ public virtual Response SetTags(IDictionary SetTags(IDictionary /// /// Resource - /// + /// /// /// /// /// The key for the tag. /// The cancellation token to use. /// is null. - public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); - using var scope = _licenseProfileClientDiagnostics.CreateScope("LicenseProfileResource.RemoveTag"); + using var scope = _hybridComputeLicenseProfileLicenseProfilesClientDiagnostics.CreateScope("HybridComputeLicenseProfileResource.RemoveTag"); scope.Start(); try { @@ -712,13 +712,13 @@ public virtual async Task> RemoveTagAsync(strin var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.Remove(key); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _licenseProfileRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new LicenseProfileResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = await _hybridComputeLicenseProfileLicenseProfilesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new HybridComputeLicenseProfileResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new LicenseProfilePatch(); + var patch = new HybridComputeLicenseProfilePatch(); foreach (var tag in current.Tags) { patch.Tags.Add(tag); @@ -752,18 +752,18 @@ public virtual async Task> RemoveTagAsync(strin /// /// /// Resource - /// + /// /// /// /// /// The key for the tag. /// The cancellation token to use. /// is null. - public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) { Argument.AssertNotNull(key, nameof(key)); - using var scope = _licenseProfileClientDiagnostics.CreateScope("LicenseProfileResource.RemoveTag"); + using var scope = _hybridComputeLicenseProfileLicenseProfilesClientDiagnostics.CreateScope("HybridComputeLicenseProfileResource.RemoveTag"); scope.Start(); try { @@ -772,13 +772,13 @@ public virtual Response RemoveTag(string key, Cancellati var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.Remove(key); GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _licenseProfileRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken); - return Response.FromValue(new LicenseProfileResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + var originalResponse = _hybridComputeLicenseProfileLicenseProfilesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, cancellationToken); + return Response.FromValue(new HybridComputeLicenseProfileResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else { var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new LicenseProfilePatch(); + var patch = new HybridComputeLicenseProfilePatch(); foreach (var tag in current.Tags) { patch.Tags.Add(tag); diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineResource.cs index 3f97866153e77..8550132f7f75c 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineResource.cs @@ -103,11 +103,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); } - /// Gets an object representing a LicenseProfileResource along with the instance operations that can be performed on it in the HybridComputeMachine. - /// Returns a object. - public virtual LicenseProfileResource GetLicenseProfile() + /// Gets an object representing a HybridComputeLicenseProfileResource along with the instance operations that can be performed on it in the HybridComputeMachine. + /// Returns a object. + public virtual HybridComputeLicenseProfileResource GetHybridComputeLicenseProfile() { - return new LicenseProfileResource(Client, Id.AppendChildResource("licenseProfiles", "default")); + return new HybridComputeLicenseProfileResource(Client, Id.AppendChildResource("licenseProfiles", "default")); } /// Gets a collection of HybridComputeMachineExtensionResources in the HybridComputeMachine. diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LicenseProfileResource.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LicenseProfileResource.Serialization.cs deleted file mode 100644 index bc3be367d78a2..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LicenseProfileResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.HybridCompute -{ - public partial class LicenseProfileResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - LicenseProfileData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - LicenseProfileData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/HybridComputeLicenseProfileOperationSource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/HybridComputeLicenseProfileOperationSource.cs new file mode 100644 index 0000000000000..7bf438bf13f06 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/HybridComputeLicenseProfileOperationSource.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.HybridCompute +{ + internal class HybridComputeLicenseProfileOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal HybridComputeLicenseProfileOperationSource(ArmClient client) + { + _client = client; + } + + HybridComputeLicenseProfileResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = HybridComputeLicenseProfileData.DeserializeHybridComputeLicenseProfileData(document.RootElement); + return new HybridComputeLicenseProfileResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = HybridComputeLicenseProfileData.DeserializeHybridComputeLicenseProfileData(document.RootElement); + return new HybridComputeLicenseProfileResource(_client, data); + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/LicenseProfileOperationSource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/LicenseProfileOperationSource.cs deleted file mode 100644 index d3a4e82e65a00..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/LicenseProfileOperationSource.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure.Core; - -namespace Azure.ResourceManager.HybridCompute -{ - internal class LicenseProfileOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal LicenseProfileOperationSource(ArmClient client) - { - _client = client; - } - - LicenseProfileResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = LicenseProfileData.DeserializeLicenseProfileData(document.RootElement); - return new LicenseProfileResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = LicenseProfileData.DeserializeLicenseProfileData(document.RootElement); - return new LicenseProfileResource(_client, data); - } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfilePatch.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLicenseProfilePatch.Serialization.cs similarity index 83% rename from sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfilePatch.Serialization.cs rename to sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLicenseProfilePatch.Serialization.cs index a8844d095c1f5..c7af9a54045e4 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfilePatch.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLicenseProfilePatch.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.HybridCompute.Models { - public partial class LicenseProfilePatch : IUtf8JsonSerializable, IJsonModel + public partial class HybridComputeLicenseProfilePatch : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { writer.WriteStartObject(); JsonModelWriteCore(writer, options); @@ -28,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri /// The client options for reading and writing models. protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LicenseProfilePatch)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(HybridComputeLicenseProfilePatch)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); @@ -79,19 +79,19 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WriteEndObject(); } - LicenseProfilePatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + HybridComputeLicenseProfilePatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(LicenseProfilePatch)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(HybridComputeLicenseProfilePatch)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeLicenseProfilePatch(document.RootElement, options); + return DeserializeHybridComputeLicenseProfilePatch(document.RootElement, options); } - internal static LicenseProfilePatch DeserializeLicenseProfilePatch(JsonElement element, ModelReaderWriterOptions options = null) + internal static HybridComputeLicenseProfilePatch DeserializeHybridComputeLicenseProfilePatch(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -223,7 +223,7 @@ internal static LicenseProfilePatch DeserializeLicenseProfilePatch(JsonElement e } } serializedAdditionalRawData = rawDataDictionary; - return new LicenseProfilePatch( + return new HybridComputeLicenseProfilePatch( tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, subscriptionStatus, @@ -233,35 +233,35 @@ internal static LicenseProfilePatch DeserializeLicenseProfilePatch(JsonElement e softwareAssuranceCustomer); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": return ModelReaderWriter.Write(this, options); default: - throw new FormatException($"The model {nameof(LicenseProfilePatch)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(HybridComputeLicenseProfilePatch)} does not support writing '{options.Format}' format."); } } - LicenseProfilePatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + HybridComputeLicenseProfilePatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; switch (format) { case "J": { using JsonDocument document = JsonDocument.Parse(data); - return DeserializeLicenseProfilePatch(document.RootElement, options); + return DeserializeHybridComputeLicenseProfilePatch(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(LicenseProfilePatch)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(HybridComputeLicenseProfilePatch)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfilePatch.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLicenseProfilePatch.cs similarity index 75% rename from sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfilePatch.cs rename to sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLicenseProfilePatch.cs index 377732bc75d68..44081707c2e7e 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfilePatch.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLicenseProfilePatch.cs @@ -11,15 +11,15 @@ namespace Azure.ResourceManager.HybridCompute.Models { /// Describes a License Profile Update. - public partial class LicenseProfilePatch : HybridComputeResourceUpdate + public partial class HybridComputeLicenseProfilePatch : HybridComputeResourceUpdate { - /// Initializes a new instance of . - public LicenseProfilePatch() + /// Initializes a new instance of . + public HybridComputeLicenseProfilePatch() { ProductFeatures = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// Resource tags. /// Keeps track of any properties unknown to the library. /// Indicates the subscription status of the product. @@ -27,7 +27,7 @@ public LicenseProfilePatch() /// The list of product feature updates. /// The resource id of the license. /// Specifies if this machine is licensed as part of a Software Assurance agreement. - internal LicenseProfilePatch(IDictionary tags, IDictionary serializedAdditionalRawData, LicenseProfileSubscriptionStatusUpdate? subscriptionStatus, LicenseProfileProductType? productType, IList productFeatures, string assignedLicense, bool? softwareAssuranceCustomer) : base(tags, serializedAdditionalRawData) + internal HybridComputeLicenseProfilePatch(IDictionary tags, IDictionary serializedAdditionalRawData, LicenseProfileSubscriptionStatusUpdate? subscriptionStatus, LicenseProfileProductType? productType, IList productFeatures, string assignedLicense, bool? softwareAssuranceCustomer) : base(tags, serializedAdditionalRawData) { SubscriptionStatus = subscriptionStatus; ProductType = productType; diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfilesListResult.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfilesListResult.Serialization.cs index 222cda4eb76cd..0e96145301efa 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfilesListResult.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfilesListResult.Serialization.cs @@ -85,7 +85,7 @@ internal static LicenseProfilesListResult DeserializeLicenseProfilesListResult(J { return null; } - IReadOnlyList value = default; + IReadOnlyList value = default; string nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); @@ -93,10 +93,10 @@ internal static LicenseProfilesListResult DeserializeLicenseProfilesListResult(J { if (property.NameEquals("value"u8)) { - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(LicenseProfileData.DeserializeLicenseProfileData(item, options)); + array.Add(HybridComputeLicenseProfileData.DeserializeHybridComputeLicenseProfileData(item, options)); } value = array; continue; diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfilesListResult.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfilesListResult.cs index 57170847a2308..e2d54e78e54b8 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfilesListResult.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfilesListResult.cs @@ -49,7 +49,7 @@ internal partial class LicenseProfilesListResult /// Initializes a new instance of . /// The list of license profiles. /// is null. - internal LicenseProfilesListResult(IEnumerable value) + internal LicenseProfilesListResult(IEnumerable value) { Argument.AssertNotNull(value, nameof(value)); @@ -60,7 +60,7 @@ internal LicenseProfilesListResult(IEnumerable value) /// The list of license profiles. /// The URI to fetch the next page of Machines. Call ListNext() with this URI to fetch the next page of license profile. /// Keeps track of any properties unknown to the library. - internal LicenseProfilesListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal LicenseProfilesListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; @@ -73,7 +73,7 @@ internal LicenseProfilesListResult() } /// The list of license profiles. - public IReadOnlyList Value { get; } + public IReadOnlyList Value { get; } /// The URI to fetch the next page of Machines. Call ListNext() with this URI to fetch the next page of license profile. public string NextLink { get; } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/LicenseProfilesRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/LicenseProfilesRestOperations.cs index 3765a535537e5..8c86ed242e388 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/LicenseProfilesRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/LicenseProfilesRestOperations.cs @@ -36,7 +36,7 @@ public LicenseProfilesRestOperations(HttpPipeline pipeline, string applicationId _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string machineName, LicenseProfileData data) + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string machineName, HybridComputeLicenseProfileData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -52,7 +52,7 @@ internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, return uri; } - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string machineName, LicenseProfileData data) + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string machineName, HybridComputeLicenseProfileData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -86,7 +86,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string machineName, LicenseProfileData data, CancellationToken cancellationToken = default) + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string machineName, HybridComputeLicenseProfileData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -113,7 +113,7 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string machineName, LicenseProfileData data, CancellationToken cancellationToken = default) + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string machineName, HybridComputeLicenseProfileData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -132,7 +132,7 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string machineName, LicenseProfilePatch patch) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string machineName, HybridComputeLicenseProfilePatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -148,7 +148,7 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string machineName, LicenseProfilePatch patch) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string machineName, HybridComputeLicenseProfilePatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -182,7 +182,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string machineName, LicenseProfilePatch patch, CancellationToken cancellationToken = default) + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string machineName, HybridComputeLicenseProfilePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -209,7 +209,7 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr /// The cancellation token to use. /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string machineName, LicenseProfilePatch patch, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string machineName, HybridComputeLicenseProfilePatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -273,7 +273,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string machineName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string machineName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -285,13 +285,13 @@ public async Task> GetAsync(string subscriptionId, { case 200: { - LicenseProfileData value = default; + HybridComputeLicenseProfileData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = LicenseProfileData.DeserializeLicenseProfileData(document.RootElement); + value = HybridComputeLicenseProfileData.DeserializeHybridComputeLicenseProfileData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((LicenseProfileData)null, message.Response); + return Response.FromValue((HybridComputeLicenseProfileData)null, message.Response); default: throw new RequestFailedException(message.Response); } @@ -304,7 +304,7 @@ public async Task> GetAsync(string subscriptionId, /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string machineName, CancellationToken cancellationToken = default) + public Response Get(string subscriptionId, string resourceGroupName, string machineName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -316,13 +316,13 @@ public Response Get(string subscriptionId, string resourceGr { case 200: { - LicenseProfileData value = default; + HybridComputeLicenseProfileData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = LicenseProfileData.DeserializeLicenseProfileData(document.RootElement); + value = HybridComputeLicenseProfileData.DeserializeHybridComputeLicenseProfileData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((LicenseProfileData)null, message.Response); + return Response.FromValue((HybridComputeLicenseProfileData)null, message.Response); default: throw new RequestFailedException(message.Response); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md index 2ed262648e699..f84f9b8e23318 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md @@ -31,7 +31,6 @@ prepend-rp-prefix: - CloudMetadata - ConfigurationExtension - ConnectionDetail - - ExecutionState - ExtensionValue - IpAddress - License @@ -65,9 +64,8 @@ prepend-rp-prefix: - ProvisioningIssue - ProvisioningIssueSeverity - ProvisioningIssueType - - Gateway - - GatewayUpdate - - GatewayType + - LicenseProfile + - LicenseProfileUpdate - ProductFeatureUpdate list-exception: @@ -101,19 +99,11 @@ rename-mapping: PatchServiceUsed.YUM: Yum PatchServiceUsed.APT: Apt PrivateLinkScopeValidationDetails.id: -|arm-id - RunCommandManagedIdentity.clientId: -|uuid - RunCommandManagedIdentity.objectId: -|uuid StatusLevelTypes: HybridComputeStatusLevelType StatusTypes: HybridComputeStatusType OSProfileWindowsConfiguration.patchSettings.enableHotpatching: IsHotpatchingEnabled PatchSettingsStatus: HybridComputePatchSettingsStatus - Settings: HybridComputeTargetResourceSettings OSProfileLinuxConfiguration.patchSettings.enableHotpatching: IsHotpatchingEnabled - LicenseProfileData: HybridComputeLicenseProfileData - LicenseProfilePatch: HybridComputeLicenseProfilePatch - -override-operation-name: - Settings_Update: UpdateTargetResourceSetting format-by-name-rules: 'tenantId': 'uuid'