From b2d824825c9e2aefea14829a0c13ce672d95cb58 Mon Sep 17 00:00:00 2001 From: Yao Tong Date: Wed, 19 Jun 2024 14:36:46 -0400 Subject: [PATCH 1/8] generate code --- ...e_HybridComputeExtensionValueCollection.cs | 8 +- ...ple_HybridComputeExtensionValueResource.cs | 2 +- .../Sample_HybridComputeLicenseCollection.cs | 10 +- .../Sample_HybridComputeLicenseResource.cs | 8 +- .../Sample_HybridComputeMachineCollection.cs | 14 +- ...HybridComputeMachineExtensionCollection.cs | 10 +- ...e_HybridComputeMachineExtensionResource.cs | 6 +- .../Sample_HybridComputeMachineResource.cs | 23 +-- ...putePrivateEndpointConnectionCollection.cs | 10 +- ...omputePrivateEndpointConnectionResource.cs | 6 +- ...Sample_HybridComputePrivateLinkResource.cs | 2 +- ...ridComputePrivateLinkResourceCollection.cs | 8 +- ...HybridComputePrivateLinkScopeCollection.cs | 12 +- ...e_HybridComputePrivateLinkScopeResource.cs | 10 +- .../Sample_MachineRunCommandCollection.cs | 10 +- .../Sample_MachineRunCommandResource.cs | 6 +- ...ecurityPerimeterConfigurationCollection.cs | 8 +- ...kSecurityPerimeterConfigurationResource.cs | 2 +- .../Generated/ArmHybridComputeModelFactory.cs | 51 ++++++- .../Extensions/HybridComputeExtensions.cs | 32 ++-- ...kableHybridComputeResourceGroupResource.cs | 12 +- ...ckableHybridComputeSubscriptionResource.cs | 20 +-- .../HybridComputeExtensionValueCollection.cs | 16 +- .../HybridComputeExtensionValueResource.cs | 4 +- .../HybridComputeLicenseCollection.cs | 20 +-- .../Generated/HybridComputeLicenseResource.cs | 24 +-- .../HybridComputeMachineCollection.cs | 16 +- ...HybridComputeMachineExtensionCollection.cs | 20 +-- .../HybridComputeMachineExtensionResource.cs | 24 +-- .../Generated/HybridComputeMachineResource.cs | 52 +++---- ...putePrivateEndpointConnectionCollection.cs | 20 +-- ...omputePrivateEndpointConnectionResource.cs | 12 +- .../HybridComputePrivateLinkResource.cs | 4 +- ...ridComputePrivateLinkResourceCollection.cs | 16 +- ...HybridComputePrivateLinkScopeCollection.cs | 20 +-- .../HybridComputePrivateLinkScopeResource.cs | 36 ++--- .../Generated/MachineRunCommandCollection.cs | 20 +-- .../Generated/MachineRunCommandResource.cs | 24 +-- .../Models/HotpatchEnablementStatus.cs | 60 ++++++++ ...ComputeLinuxConfiguration.Serialization.cs | 32 +++- .../Models/HybridComputeLinuxConfiguration.cs | 10 +- ...bridComputeProductFeature.Serialization.cs | 54 +++++-- .../Models/HybridComputeProductFeature.cs | 18 ++- ...mputeWindowsConfiguration.Serialization.cs | 32 +++- .../HybridComputeWindowsConfiguration.cs | 10 +- ...rofileMachineInstanceView.Serialization.cs | 54 +++++-- .../LicenseProfileMachineInstanceView.cs | 18 ++- .../LicenseProfileSubscriptionStatus.cs | 6 + .../PatchSettingsStatus.Serialization.cs | 141 ++++++++++++++++++ .../Generated/Models/PatchSettingsStatus.cs | 69 +++++++++ ...ecurityPerimeterConfigurationCollection.cs | 16 +- ...kSecurityPerimeterConfigurationResource.cs | 4 +- .../ExtensionMetadataRestOperations.cs | 2 +- .../HybridComputeManagementRestOperations.cs | 2 +- .../RestOperations/LicensesRestOperations.cs | 2 +- .../MachineExtensionsRestOperations.cs | 2 +- .../MachineRunCommandsRestOperations.cs | 2 +- .../RestOperations/MachinesRestOperations.cs | 2 +- .../NetworkProfileRestOperations.cs | 2 +- ...tyPerimeterConfigurationsRestOperations.cs | 2 +- ...rivateEndpointConnectionsRestOperations.cs | 2 +- .../PrivateLinkResourcesRestOperations.cs | 2 +- .../PrivateLinkScopesRestOperations.cs | 2 +- .../src/autorest.md | 4 +- 64 files changed, 809 insertions(+), 339 deletions(-) create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HotpatchEnablementStatus.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PatchSettingsStatus.Serialization.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PatchSettingsStatus.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 211d1c4b6ac8e..2908a212fe8e0 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-03-31-preview/examples/extension/ExtensionMetadata_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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-03-31-preview/examples/extension/ExtensionMetadata_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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-03-31-preview/examples/extension/ExtensionMetadata_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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-03-31-preview/examples/extension/ExtensionMetadata_List.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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 203dca7ca6a53..bef2169de97ce 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-03-31-preview/examples/extension/ExtensionMetadata_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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_HybridComputeLicenseCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeLicenseCollection.cs index b6194e08a9441..d7eef633c8c70 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-03-31-preview/examples/license/License_CreateOrUpdate.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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-03-31-preview/examples/license/License_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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-03-31-preview/examples/license/License_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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-03-31-preview/examples/license/License_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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-03-31-preview/examples/license/License_ListByResourceGroup.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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 5fc16c89a4ace..88669e9d01275 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 @@ -21,7 +21,7 @@ public partial class Sample_HybridComputeLicenseResource [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-03-31-preview/examples/license/License_CreateOrUpdate.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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 +65,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-03-31-preview/examples/license/License_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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 +96,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-03-31-preview/examples/license/License_Delete.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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 +123,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-03-31-preview/examples/license/License_ListBySubscription.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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 6d6e6f433b082..959fcb7422d54 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 @@ -20,7 +20,7 @@ public partial class Sample_HybridComputeMachineCollection [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-03-31-preview/examples/machine/Machines_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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 +54,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-03-31-preview/examples/machine/Machines_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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 +84,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-03-31-preview/examples/machine/Machines_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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 +126,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-03-31-preview/examples/machine/Machines_Get_LicenseProfileInstanceView.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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 +161,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-03-31-preview/examples/machine/Machines_Get_LicenseProfileInstanceView.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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 +192,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-03-31-preview/examples/machine/Machines_Get_LicenseProfileInstanceView.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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 +235,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-03-31-preview/examples/machine/Machines_ListByResourceGroup.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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 a306af6117467..5ce6c15a5c07d 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-03-31-preview/examples/extension/Extension_CreateOrUpdate.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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-03-31-preview/examples/extension/Extension_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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-03-31-preview/examples/extension/Extension_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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-03-31-preview/examples/extension/Extension_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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-03-31-preview/examples/extension/Extension_List.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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 a11e1c1361469..e4cffeaa76b53 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-03-31-preview/examples/extension/Extension_Update.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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-03-31-preview/examples/extension/Extension_Delete.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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-03-31-preview/examples/extension/Extension_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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 0d6e2ca4e78ff..3771362a9a16a 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-03-31-preview/examples/machine/Machines_Update.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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 @@ -49,7 +49,8 @@ public async Task Update_UpdateAMachine() WindowsConfiguration = new HybridComputeWindowsConfiguration() { AssessmentMode = AssessmentModeType.ImageDefault, - PatchMode = PatchModeType.Manual, + PatchMode = PatchModeType.AutomaticByPlatform, + EnableHotpatching = true, }, LinuxConfiguration = new HybridComputeLinuxConfiguration() { @@ -74,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-03-31-preview/examples/machine/Machines_Delete.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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 @@ -101,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-03-31-preview/examples/machine/Machines_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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 @@ -132,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-03-31-preview/examples/machine/Machines_Get_LicenseProfileInstanceView.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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 @@ -164,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-03-31-preview/examples/machine/Machine_AssessPatches.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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 @@ -192,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-03-31-preview/examples/machine/Machine_InstallPatches.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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 @@ -231,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-03-31-preview/examples/machine/Machines_ListBySubscription.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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 @@ -263,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-03-31-preview/examples/extension/Extensions_Upgrade.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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 @@ -304,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-03-31-preview/examples/NetworkProfile_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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 @@ -331,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-03-31-preview/examples/privateLinkScope/PrivateLinkScopes_GetValidationForMachine.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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 1287ee586e761..58f5c8ae798b6 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-03-31-preview/examples/privateEndpoint/PrivateEndpointConnection_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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-03-31-preview/examples/privateEndpoint/PrivateEndpointConnection_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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-03-31-preview/examples/privateEndpoint/PrivateEndpointConnection_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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-03-31-preview/examples/privateEndpoint/PrivateEndpointConnection_Update.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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-03-31-preview/examples/privateEndpoint/PrivateEndpointConnection_List.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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 4b9fe12f0f55f..a7403d83761ac 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-03-31-preview/examples/privateEndpoint/PrivateEndpointConnection_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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-03-31-preview/examples/privateEndpoint/PrivateEndpointConnection_Update.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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-03-31-preview/examples/privateEndpoint/PrivateEndpointConnection_Delete.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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 13d38ff2252db..96f9b52370d64 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-03-31-preview/examples/privateLinkScope/PrivateLinkScopePrivateLinkResource_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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 71eaedee61c42..60272471ecf9d 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-03-31-preview/examples/privateLinkScope/PrivateLinkScopePrivateLinkResource_ListGet.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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-03-31-preview/examples/privateLinkScope/PrivateLinkScopePrivateLinkResource_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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-03-31-preview/examples/privateLinkScope/PrivateLinkScopePrivateLinkResource_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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-03-31-preview/examples/privateLinkScope/PrivateLinkScopePrivateLinkResource_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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 414a2e8921179..161dd96e3778e 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-03-31-preview/examples/privateLinkScope/PrivateLinkScopes_ListByResourceGroup.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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-03-31-preview/examples/privateLinkScope/PrivateLinkScopes_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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-03-31-preview/examples/privateLinkScope/PrivateLinkScopes_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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-03-31-preview/examples/privateLinkScope/PrivateLinkScopes_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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-03-31-preview/examples/privateLinkScope/PrivateLinkScopes_Create.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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-03-31-preview/examples/privateLinkScope/PrivateLinkScopes_Update.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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 f95e2984f7233..72268c0d432f2 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-03-31-preview/examples/privateLinkScope/PrivateLinkScopes_List.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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-03-31-preview/examples/privateLinkScope/PrivateLinkScopes_Delete.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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-03-31-preview/examples/privateLinkScope/PrivateLinkScopes_Get.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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-03-31-preview/examples/privateLinkScope/PrivateLinkScopes_UpdateTagsOnly.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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-03-31-preview/examples/privateLinkScope/PrivateLinkScopes_GetValidation.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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_MachineRunCommandCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_MachineRunCommandCollection.cs index 3a19e1859f6be..6a33a25bedc1d 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_MachineRunCommandCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_MachineRunCommandCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineRunCommandCollection [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-03-31-preview/examples/runCommand/RunCommands_CreateOrUpdate.json + // 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 @@ -73,7 +73,7 @@ public async Task CreateOrUpdate_CreateOrUpdateARunCommand() [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-03-31-preview/examples/runCommand/RunCommands_Get.json + // 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 @@ -108,7 +108,7 @@ public async Task Get_GetARunCommand() [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-03-31-preview/examples/runCommand/RunCommands_Get.json + // 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 @@ -139,7 +139,7 @@ public async Task Exists_GetARunCommand() [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-03-31-preview/examples/runCommand/RunCommands_Get.json + // 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 @@ -182,7 +182,7 @@ public async Task GetIfExists_GetARunCommand() [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-03-31-preview/examples/runCommand/RunCommands_List.json + // 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 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 index 829f71c3ee33f..54a5b34be7461 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_MachineRunCommandResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_MachineRunCommandResource.cs @@ -20,7 +20,7 @@ public partial class Sample_MachineRunCommandResource [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-03-31-preview/examples/runCommand/RunCommands_CreateOrUpdate.json + // 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 @@ -70,7 +70,7 @@ public async Task Update_CreateOrUpdateARunCommand() [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-03-31-preview/examples/runCommand/RunCommands_Delete.json + // 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 @@ -98,7 +98,7 @@ public async Task Delete_DeleteAMachineRunCommand() [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-03-31-preview/examples/runCommand/RunCommands_Get.json + // 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 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 2b437207d744f..aaf9fa758c931 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-03-31-preview/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationGet.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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-03-31-preview/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationGet.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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-03-31-preview/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationGet.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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-03-31-preview/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationList.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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 d9f47f51b85c1..e33394f7fccc9 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 @@ -19,7 +19,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-03-31-preview/examples/networkSecurityPerimeterConfiguration/NetworkSecurityPerimeterConfigurationGet.json + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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 diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArmHybridComputeModelFactory.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArmHybridComputeModelFactory.cs index 062b3923a067b..84ee05d554373 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArmHybridComputeModelFactory.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArmHybridComputeModelFactory.cs @@ -82,6 +82,37 @@ public static HybridComputeOSProfile HybridComputeOSProfile(string computerName 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? enableHotpatching = null, PatchSettingsStatus status = null) + { + return new HybridComputeWindowsConfiguration(assessmentMode, patchMode, enableHotpatching, 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 PatchSettingsStatus PatchSettingsStatus(HotpatchEnablementStatus? hotpatchEnablementStatus = null, ResponseError error = null) + { + return new PatchSettingsStatus(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? enableHotpatching = null, PatchSettingsStatus status = null) + { + return new HybridComputeLinuxConfiguration(assessmentMode, patchMode, enableHotpatching, 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. @@ -243,13 +274,15 @@ public static HybridComputeConfigurationExtension HybridComputeConfigurationExte /// Properties for the Machine ESU profile. /// Indicates the subscription status of the product. /// Indicates the product type of the license. - /// The timestamp in UTC when the billing starts. /// 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. /// Specifies if this machine is licensed as part of a Software Assurance agreement. /// A new instance for mocking. - public static LicenseProfileMachineInstanceView LicenseProfileMachineInstanceView(HybridComputeLicenseStatus? licenseStatus = null, string licenseChannel = null, LicenseProfileMachineInstanceViewEsuProperties esuProfile = null, LicenseProfileSubscriptionStatus? subscriptionStatus = null, LicenseProfileProductType? productType = null, DateTimeOffset? billingStartOn = null, DateTimeOffset? enrollmentOn = null, DateTimeOffset? disenrollmentOn = null, IEnumerable productFeatures = null, bool? isSoftwareAssuranceCustomer = null) + public static LicenseProfileMachineInstanceView LicenseProfileMachineInstanceView(HybridComputeLicenseStatus? licenseStatus = null, string licenseChannel = null, LicenseProfileMachineInstanceViewEsuProperties esuProfile = 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, bool? isSoftwareAssuranceCustomer = null) { productFeatures ??= new List(); @@ -259,9 +292,11 @@ public static LicenseProfileMachineInstanceView LicenseProfileMachineInstanceVie esuProfile, subscriptionStatus, productType, - billingStartOn, enrollmentOn, + billingStartOn, disenrollmentOn, + billingEndOn, + error, productFeatures?.ToList(), isSoftwareAssuranceCustomer, serializedAdditionalRawData: null); @@ -334,18 +369,22 @@ public static EsuKey EsuKey(string sku = null, int? licenseStatus = null) /// Initializes a new instance of . /// Product feature name. /// Indicates the current status of the product features. - /// The timestamp in UTC when the billing starts. /// 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. /// A new instance for mocking. - public static HybridComputeProductFeature HybridComputeProductFeature(string name = null, LicenseProfileSubscriptionStatus? subscriptionStatus = null, DateTimeOffset? billingStartOn = null, DateTimeOffset? enrollmentOn = null, DateTimeOffset? disenrollmentOn = null) + public static HybridComputeProductFeature HybridComputeProductFeature(string name = null, LicenseProfileSubscriptionStatus? subscriptionStatus = null, DateTimeOffset? enrollmentOn = null, DateTimeOffset? billingStartOn = null, DateTimeOffset? disenrollmentOn = null, DateTimeOffset? billingEndOn = null, ResponseError error = null) { return new HybridComputeProductFeature( name, subscriptionStatus, - billingStartOn, enrollmentOn, + billingStartOn, disenrollmentOn, + billingEndOn, + error, 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 9180956cd60e5..89c0b18a38a86 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/HybridComputeExtensions.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/HybridComputeExtensions.cs @@ -234,7 +234,7 @@ public static HybridComputeLicenseCollection GetHybridComputeLicenses(this Resou /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -272,7 +272,7 @@ public static async Task> GetHybridComput /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -327,7 +327,7 @@ public static HybridComputeMachineCollection GetHybridComputeMachines(this Resou /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -366,7 +366,7 @@ public static async Task> GetHybridComput /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -422,7 +422,7 @@ public static HybridComputePrivateLinkScopeCollection GetHybridComputePrivateLin /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -460,7 +460,7 @@ public static async Task> GetHyb /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -519,7 +519,7 @@ public static HybridComputeExtensionValueCollection GetHybridComputeExtensionVal /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -560,7 +560,7 @@ public static async Task> GetHybri /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -601,7 +601,7 @@ public static Response GetHybridComputeExte /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -637,7 +637,7 @@ public static AsyncPageable GetHybridComputeLicens /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -673,7 +673,7 @@ public static Pageable GetHybridComputeLicenses(th /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -709,7 +709,7 @@ public static AsyncPageable GetHybridComputeMachin /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -745,7 +745,7 @@ public static Pageable GetHybridComputeMachines(th /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -781,7 +781,7 @@ public static AsyncPageable GetHybridComp /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -817,7 +817,7 @@ public static Pageable GetHybridComputePr /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -855,7 +855,7 @@ public static async Task> GetValidat /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource 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 afa229eef6865..fa1ed656da0f6 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeResourceGroupResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeResourceGroupResource.cs @@ -53,7 +53,7 @@ public virtual HybridComputeLicenseCollection GetHybridComputeLicenses() /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -84,7 +84,7 @@ public virtual async Task> GetHybridCompu /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -122,7 +122,7 @@ public virtual HybridComputeMachineCollection GetHybridComputeMachines() /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -154,7 +154,7 @@ public virtual async Task> GetHybridCompu /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -193,7 +193,7 @@ public virtual HybridComputePrivateLinkScopeCollection GetHybridComputePrivateLi /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task> GetHy /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource 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 f15954a80e232..d4de7ae01762b 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeSubscriptionResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeSubscriptionResource.cs @@ -75,7 +75,7 @@ public virtual HybridComputeExtensionValueCollection GetHybridComputeExtensionVa /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task> GetHybr /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual Response GetHybridComputeExt /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -173,7 +173,7 @@ public virtual AsyncPageable GetHybridComputeLicen /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -203,7 +203,7 @@ public virtual Pageable GetHybridComputeLicenses(C /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -233,7 +233,7 @@ public virtual AsyncPageable GetHybridComputeMachi /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -263,7 +263,7 @@ public virtual Pageable GetHybridComputeMachines(C /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -293,7 +293,7 @@ public virtual AsyncPageable GetHybridCom /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -323,7 +323,7 @@ public virtual Pageable GetHybridComputeP /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -367,7 +367,7 @@ public virtual async Task> GetValida /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeExtensionValueCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeExtensionValueCollection.cs index 3865fb3af2ec0..805cb45af6ba4 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-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -121,7 +121,7 @@ public virtual async Task> GetAsyn /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -166,7 +166,7 @@ public virtual Response Get(string version, /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -195,7 +195,7 @@ public virtual AsyncPageable GetAllAsync(Ca /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -224,7 +224,7 @@ public virtual Pageable GetAll(Cancellation /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -267,7 +267,7 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -310,7 +310,7 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeExtensionValueResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeExtensionValueResource.cs index c36c154dfc2dc..190328fd514ca 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-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAsyn /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseCollection.cs index 28d3f3eea6511..0fc032155a028 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-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUp /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUnt /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(strin /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string licenseName, Ca /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(Cancellat /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken c /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string licenseName, Cancel /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string licenseName, CancellationToken cance /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> GetIfE /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseResource.cs index 278cf084c31a4..d9b03e64d433f 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-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(Cance /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken canc /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> UpdateAsyn /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -358,7 +358,7 @@ public virtual ArmOperation Update(WaitUntil waitU /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -415,7 +415,7 @@ public virtual async Task> AddTagAsync(st /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -472,7 +472,7 @@ public virtual Response AddTag(string key, string /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -528,7 +528,7 @@ public virtual async Task> SetTagsAsync(I /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -584,7 +584,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -639,7 +639,7 @@ public virtual async Task> RemoveTagAsync /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineCollection.cs index 4bb18ca0c7916..4773f96550d2f 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -111,7 +111,7 @@ public virtual async Task> GetAsync(strin /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -157,7 +157,7 @@ public virtual Response Get(string machineName, st /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -188,7 +188,7 @@ public virtual AsyncPageable GetAllAsync(string ex /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -219,7 +219,7 @@ public virtual Pageable GetAll(string expand = nul /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -263,7 +263,7 @@ public virtual async Task> ExistsAsync(string machineName, string /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -307,7 +307,7 @@ public virtual Response Exists(string machineName, string expand = null, C /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -353,7 +353,7 @@ public virtual async Task> GetIfE /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineExtensionCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineExtensionCollection.cs index c5ad44264d585..738c7626c5e6b 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-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> C /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdat /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAs /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string extens /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync( /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -314,7 +314,7 @@ public virtual Pageable GetAll(string exp /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -357,7 +357,7 @@ public virtual async Task> ExistsAsync(string extensionName, Canc /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -400,7 +400,7 @@ public virtual Response Exists(string extensionName, CancellationToken can /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -445,7 +445,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineExtensionResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineExtensionResource.cs index 91e520e451772..4eba82d0e25db 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-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -143,7 +143,7 @@ public virtual async Task> GetAs /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -183,7 +183,7 @@ public virtual Response Get(CancellationT /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -225,7 +225,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -267,7 +267,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -313,7 +313,7 @@ public virtual async Task> U /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -359,7 +359,7 @@ public virtual ArmOperation Update(WaitUn /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -421,7 +421,7 @@ public virtual async Task> AddTa /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -483,7 +483,7 @@ public virtual Response AddTag(string key /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -540,7 +540,7 @@ public virtual async Task> SetTa /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -597,7 +597,7 @@ public virtual Response SetTags(IDictiona /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -657,7 +657,7 @@ public virtual async Task> Remov /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineResource.cs index fb688a2502105..1ddc3b882e569 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineResource.cs @@ -123,7 +123,7 @@ public virtual HybridComputeMachineExtensionCollection GetHybridComputeMachineEx /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -154,7 +154,7 @@ public virtual async Task> GetHy /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -192,7 +192,7 @@ public virtual MachineRunCommandCollection GetMachineRunCommands() /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task> GetMachineRunComm /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -254,7 +254,7 @@ public virtual Response GetMachineRunCommand(string r /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -295,7 +295,7 @@ public virtual async Task> GetAsync(strin /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -336,7 +336,7 @@ public virtual Response Get(string expand = null, /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -380,7 +380,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -424,7 +424,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -466,7 +466,7 @@ public virtual async Task> UpdateAsync(Hy /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -508,7 +508,7 @@ public virtual Response Update(HybridComputeMachin /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -550,7 +550,7 @@ public virtual async Task> AssessPatche /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -592,7 +592,7 @@ public virtual ArmOperation AssessPatches(WaitUntil /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -638,7 +638,7 @@ public virtual async Task> InstallPatc /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -684,7 +684,7 @@ public virtual ArmOperation InstallPatches(WaitUnti /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// @@ -726,7 +726,7 @@ public virtual async Task UpgradeExtensionsAsync(WaitUntil waitUnt /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// @@ -768,7 +768,7 @@ public virtual ArmOperation UpgradeExtensions(WaitUntil waitUntil, MachineExtens /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// @@ -802,7 +802,7 @@ public virtual async Task> GetNetworkProfi /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// @@ -836,7 +836,7 @@ public virtual Response GetNetworkProfile(Cancellat /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -874,7 +874,7 @@ public virtual async Task> GetValida /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -912,7 +912,7 @@ public virtual Response GetValidationDetailsF /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -974,7 +974,7 @@ public virtual async Task> AddTagAsync(st /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -1036,7 +1036,7 @@ public virtual Response AddTag(string key, string /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -1093,7 +1093,7 @@ public virtual async Task> SetTagsAsync(I /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -1150,7 +1150,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -1210,7 +1210,7 @@ public virtual async Task> RemoveTagAsync /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateEndpointConnectionCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateEndpointConnectionCollection.cs index 048e7f9150d94..370f7dcad8318 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-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation Crea /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(stri /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable Get /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(C /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string privateEndpointConn /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string privateEndpointConnectionName, Cance /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateEndpointConnectionResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateEndpointConnectionResource.cs index 8587835f92059..e59ef91495dc7 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-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(Canc /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -311,7 +311,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkResource.cs index b31fb91d4cf59..ec6968ee77a3a 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-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAsync(C /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkResourceCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkResourceCollection.cs index 9c645522efe8b..5a99b77da1fb7 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-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task> GetAsync(s /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get(string groupName, /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -184,7 +184,7 @@ public virtual AsyncPageable GetAllAsync(Cance /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -214,7 +214,7 @@ public virtual Pageable GetAll(CancellationTok /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -257,7 +257,7 @@ public virtual async Task> ExistsAsync(string groupName, Cancella /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -300,7 +300,7 @@ public virtual Response Exists(string groupName, CancellationToken cancell /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -345,7 +345,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkScopeCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkScopeCollection.cs index 878c2a63e71d4..52628ca177e93 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-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -116,7 +116,7 @@ public virtual async Task> C /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrUpdat /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -212,7 +212,7 @@ public virtual async Task> GetAs /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -257,7 +257,7 @@ public virtual Response Get(string scopeN /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -287,7 +287,7 @@ public virtual AsyncPageable GetAllAsync( /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -317,7 +317,7 @@ public virtual Pageable GetAll(Cancellati /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -360,7 +360,7 @@ public virtual async Task> ExistsAsync(string scopeName, Cancella /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -403,7 +403,7 @@ public virtual Response Exists(string scopeName, CancellationToken cancell /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -448,7 +448,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkScopeResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkScopeResource.cs index 95ca49c9539ee..e6bfb3145c90e 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-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetHybridC /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -179,7 +179,7 @@ public virtual HybridComputePrivateEndpointConnectionCollection GetHybridCompute /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -210,7 +210,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -248,7 +248,7 @@ public virtual NetworkSecurityPerimeterConfigurationCollection GetNetworkSecurit /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -279,7 +279,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -310,7 +310,7 @@ public virtual Response GetNetwor /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -350,7 +350,7 @@ public virtual async Task> GetAs /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -390,7 +390,7 @@ public virtual Response Get(CancellationT /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -432,7 +432,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -474,7 +474,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -516,7 +516,7 @@ public virtual async Task> Updat /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -558,7 +558,7 @@ public virtual Response Update(HybridComp /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -620,7 +620,7 @@ public virtual async Task> AddTa /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -682,7 +682,7 @@ public virtual Response AddTag(string key /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -739,7 +739,7 @@ public virtual async Task> SetTa /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -796,7 +796,7 @@ public virtual Response SetTags(IDictiona /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -856,7 +856,7 @@ public virtual async Task> Remov /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandCollection.cs index 8fce73c800cc3..ab8dee3bd73b1 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> CreateOrUpdat /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsync(string r /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string runCommandName, Ca /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(string expan /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -314,7 +314,7 @@ public virtual Pageable GetAll(string expand = null, /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -357,7 +357,7 @@ public virtual async Task> ExistsAsync(string runCommandName, Can /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -400,7 +400,7 @@ public virtual Response Exists(string runCommandName, CancellationToken ca /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -445,7 +445,7 @@ public virtual async Task> GetIfExis /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandResource.cs index 10728e0489c7c..a2e72e8173a34 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(Cancella /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken cancell /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> UpdateAsync(W /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -358,7 +358,7 @@ public virtual ArmOperation Update(WaitUntil waitUnti /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -415,7 +415,7 @@ public virtual async Task> AddTagAsync(strin /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -472,7 +472,7 @@ public virtual Response AddTag(string key, string val /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -528,7 +528,7 @@ public virtual async Task> SetTagsAsync(IDic /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -584,7 +584,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -639,7 +639,7 @@ public virtual async Task> RemoveTagAsync(st /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HotpatchEnablementStatus.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HotpatchEnablementStatus.cs new file mode 100644 index 0000000000000..59c76373f06f8 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HotpatchEnablementStatus.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// Status of hotpatch enablement or disablement. + public readonly partial struct HotpatchEnablementStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public HotpatchEnablementStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string PendingEvaluationValue = "PendingEvaluation"; + private const string DisabledValue = "Disabled"; + private const string ActionRequiredValue = "ActionRequired"; + private const string EnabledValue = "Enabled"; + + /// Unknown. + public static HotpatchEnablementStatus Unknown { get; } = new HotpatchEnablementStatus(UnknownValue); + /// PendingEvaluation. + public static HotpatchEnablementStatus PendingEvaluation { get; } = new HotpatchEnablementStatus(PendingEvaluationValue); + /// Disabled. + public static HotpatchEnablementStatus Disabled { get; } = new HotpatchEnablementStatus(DisabledValue); + /// ActionRequired. + public static HotpatchEnablementStatus ActionRequired { get; } = new HotpatchEnablementStatus(ActionRequiredValue); + /// Enabled. + public static HotpatchEnablementStatus Enabled { get; } = new HotpatchEnablementStatus(EnabledValue); + /// Determines if two values are the same. + public static bool operator ==(HotpatchEnablementStatus left, HotpatchEnablementStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(HotpatchEnablementStatus left, HotpatchEnablementStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator HotpatchEnablementStatus(string value) => new HotpatchEnablementStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is HotpatchEnablementStatus other && Equals(other); + /// + public bool Equals(HotpatchEnablementStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLinuxConfiguration.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLinuxConfiguration.Serialization.cs index 72803a088e087..9b8e1c58e3bd2 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLinuxConfiguration.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLinuxConfiguration.Serialization.cs @@ -38,6 +38,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo writer.WritePropertyName("patchMode"u8); writer.WriteStringValue(PatchMode.Value.ToString()); } + if (Optional.IsDefined(EnableHotpatching)) + { + writer.WritePropertyName("enableHotpatching"u8); + writer.WriteBooleanValue(EnableHotpatching.Value); + } + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteObjectValue(Status, options); + } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -79,6 +89,8 @@ internal static HybridComputeLinuxConfiguration DeserializeHybridComputeLinuxCon } AssessmentModeType? assessmentMode = default; PatchModeType? patchMode = default; + bool? enableHotpatching = default; + PatchSettingsStatus status = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -110,6 +122,24 @@ internal static HybridComputeLinuxConfiguration DeserializeHybridComputeLinuxCon patchMode = new PatchModeType(property0.Value.GetString()); continue; } + if (property0.NameEquals("enableHotpatching"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableHotpatching = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("status"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = PatchSettingsStatus.DeserializePatchSettingsStatus(property0.Value, options); + continue; + } } continue; } @@ -119,7 +149,7 @@ internal static HybridComputeLinuxConfiguration DeserializeHybridComputeLinuxCon } } serializedAdditionalRawData = rawDataDictionary; - return new HybridComputeLinuxConfiguration(assessmentMode, patchMode, serializedAdditionalRawData); + return new HybridComputeLinuxConfiguration(assessmentMode, patchMode, enableHotpatching, status, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLinuxConfiguration.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLinuxConfiguration.cs index 026b8de348ff0..bab2eed47220c 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLinuxConfiguration.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLinuxConfiguration.cs @@ -53,11 +53,15 @@ public HybridComputeLinuxConfiguration() /// 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. /// Keeps track of any properties unknown to the library. - internal HybridComputeLinuxConfiguration(AssessmentModeType? assessmentMode, PatchModeType? patchMode, IDictionary serializedAdditionalRawData) + internal HybridComputeLinuxConfiguration(AssessmentModeType? assessmentMode, PatchModeType? patchMode, bool? enableHotpatching, PatchSettingsStatus status, IDictionary serializedAdditionalRawData) { AssessmentMode = assessmentMode; PatchMode = patchMode; + EnableHotpatching = enableHotpatching; + Status = status; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -65,5 +69,9 @@ internal HybridComputeLinuxConfiguration(AssessmentModeType? assessmentMode, Pat public AssessmentModeType? AssessmentMode { get; set; } /// Specifies the patch mode. public PatchModeType? PatchMode { get; set; } + /// Captures the hotpatch capability enrollment intent of the customers, which enables customers to patch their Windows machines without requiring a reboot. + public bool? EnableHotpatching { get; set; } + /// Status of the hotpatch capability enrollment or disenrollment. + public PatchSettingsStatus Status { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeProductFeature.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeProductFeature.Serialization.cs index 8a04e47182834..b77b819f24e2f 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeProductFeature.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeProductFeature.Serialization.cs @@ -36,21 +36,31 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WritePropertyName("subscriptionStatus"u8); writer.WriteStringValue(SubscriptionStatus.Value.ToString()); } - if (options.Format != "W" && Optional.IsDefined(BillingStartOn)) - { - writer.WritePropertyName("billingStartDate"u8); - writer.WriteStringValue(BillingStartOn.Value, "O"); - } 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 (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -91,9 +101,11 @@ internal static HybridComputeProductFeature DeserializeHybridComputeProductFeatu } string name = default; LicenseProfileSubscriptionStatus? subscriptionStatus = default; - DateTimeOffset? billingStartDate = default; DateTimeOffset? enrollmentDate = default; + DateTimeOffset? billingStartDate = default; DateTimeOffset? disenrollmentDate = default; + DateTimeOffset? billingEndDate = default; + ResponseError error = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -112,22 +124,22 @@ internal static HybridComputeProductFeature DeserializeHybridComputeProductFeatu subscriptionStatus = new LicenseProfileSubscriptionStatus(property.Value.GetString()); continue; } - if (property.NameEquals("billingStartDate"u8)) + if (property.NameEquals("enrollmentDate"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - billingStartDate = property.Value.GetDateTimeOffset("O"); + enrollmentDate = property.Value.GetDateTimeOffset("O"); continue; } - if (property.NameEquals("enrollmentDate"u8)) + if (property.NameEquals("billingStartDate"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { continue; } - enrollmentDate = property.Value.GetDateTimeOffset("O"); + billingStartDate = property.Value.GetDateTimeOffset("O"); continue; } if (property.NameEquals("disenrollmentDate"u8)) @@ -139,6 +151,24 @@ internal static HybridComputeProductFeature DeserializeHybridComputeProductFeatu disenrollmentDate = property.Value.GetDateTimeOffset("O"); continue; } + if (property.NameEquals("billingEndDate"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + billingEndDate = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("error"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -148,9 +178,11 @@ internal static HybridComputeProductFeature DeserializeHybridComputeProductFeatu return new HybridComputeProductFeature( name, subscriptionStatus, - billingStartDate, enrollmentDate, + billingStartDate, disenrollmentDate, + billingEndDate, + error, serializedAdditionalRawData); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeProductFeature.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeProductFeature.cs index 7d7e6ef0a2e93..c769b09420af8 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeProductFeature.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeProductFeature.cs @@ -53,17 +53,21 @@ public HybridComputeProductFeature() /// Initializes a new instance of . /// Product feature name. /// Indicates the current status of the product features. - /// The timestamp in UTC when the billing starts. /// 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. /// Keeps track of any properties unknown to the library. - internal HybridComputeProductFeature(string name, LicenseProfileSubscriptionStatus? subscriptionStatus, DateTimeOffset? billingStartOn, DateTimeOffset? enrollmentOn, DateTimeOffset? disenrollmentOn, IDictionary serializedAdditionalRawData) + internal HybridComputeProductFeature(string name, LicenseProfileSubscriptionStatus? subscriptionStatus, DateTimeOffset? enrollmentOn, DateTimeOffset? billingStartOn, DateTimeOffset? disenrollmentOn, DateTimeOffset? billingEndOn, ResponseError error, IDictionary serializedAdditionalRawData) { Name = name; SubscriptionStatus = subscriptionStatus; - BillingStartOn = billingStartOn; EnrollmentOn = enrollmentOn; + BillingStartOn = billingStartOn; DisenrollmentOn = disenrollmentOn; + BillingEndOn = billingEndOn; + Error = error; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -71,11 +75,15 @@ internal HybridComputeProductFeature(string name, LicenseProfileSubscriptionStat public string Name { get; set; } /// Indicates the current status of the product features. public LicenseProfileSubscriptionStatus? SubscriptionStatus { get; set; } - /// The timestamp in UTC when the billing starts. - public DateTimeOffset? BillingStartOn { get; } /// The timestamp in UTC when the user enrolls the feature. public DateTimeOffset? EnrollmentOn { get; } + /// The timestamp in UTC when the billing starts. + public DateTimeOffset? BillingStartOn { get; } /// The timestamp in UTC when the user disenrolled the feature. public DateTimeOffset? DisenrollmentOn { get; } + /// The timestamp in UTC when the billing ends. + public DateTimeOffset? BillingEndOn { get; } + /// The errors that were encountered during the feature enrollment or disenrollment. + public ResponseError Error { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeWindowsConfiguration.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeWindowsConfiguration.Serialization.cs index 5bb59342c3587..bbdc9e659c4db 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeWindowsConfiguration.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeWindowsConfiguration.Serialization.cs @@ -38,6 +38,16 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WritePropertyName("patchMode"u8); writer.WriteStringValue(PatchMode.Value.ToString()); } + if (Optional.IsDefined(EnableHotpatching)) + { + writer.WritePropertyName("enableHotpatching"u8); + writer.WriteBooleanValue(EnableHotpatching.Value); + } + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteObjectValue(Status, options); + } writer.WriteEndObject(); if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -79,6 +89,8 @@ internal static HybridComputeWindowsConfiguration DeserializeHybridComputeWindow } AssessmentModeType? assessmentMode = default; PatchModeType? patchMode = default; + bool? enableHotpatching = default; + PatchSettingsStatus status = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -110,6 +122,24 @@ internal static HybridComputeWindowsConfiguration DeserializeHybridComputeWindow patchMode = new PatchModeType(property0.Value.GetString()); continue; } + if (property0.NameEquals("enableHotpatching"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableHotpatching = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("status"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = PatchSettingsStatus.DeserializePatchSettingsStatus(property0.Value, options); + continue; + } } continue; } @@ -119,7 +149,7 @@ internal static HybridComputeWindowsConfiguration DeserializeHybridComputeWindow } } serializedAdditionalRawData = rawDataDictionary; - return new HybridComputeWindowsConfiguration(assessmentMode, patchMode, serializedAdditionalRawData); + return new HybridComputeWindowsConfiguration(assessmentMode, patchMode, enableHotpatching, status, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeWindowsConfiguration.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeWindowsConfiguration.cs index 7fc400344e3f6..6b8f548fdd88d 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeWindowsConfiguration.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeWindowsConfiguration.cs @@ -53,11 +53,15 @@ public HybridComputeWindowsConfiguration() /// 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. /// Keeps track of any properties unknown to the library. - internal HybridComputeWindowsConfiguration(AssessmentModeType? assessmentMode, PatchModeType? patchMode, IDictionary serializedAdditionalRawData) + internal HybridComputeWindowsConfiguration(AssessmentModeType? assessmentMode, PatchModeType? patchMode, bool? enableHotpatching, PatchSettingsStatus status, IDictionary serializedAdditionalRawData) { AssessmentMode = assessmentMode; PatchMode = patchMode; + EnableHotpatching = enableHotpatching; + Status = status; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -65,5 +69,9 @@ internal HybridComputeWindowsConfiguration(AssessmentModeType? assessmentMode, P public AssessmentModeType? AssessmentMode { get; set; } /// Specifies the patch mode. public PatchModeType? PatchMode { get; set; } + /// Captures the hotpatch capability enrollment intent of the customers, which enables customers to patch their Windows machines without requiring a reboot. + public bool? EnableHotpatching { get; set; } + /// Status of the hotpatch capability enrollment or disenrollment. + public PatchSettingsStatus Status { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileMachineInstanceView.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileMachineInstanceView.Serialization.cs index 24d428a63da0c..89240515556b3 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileMachineInstanceView.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileMachineInstanceView.Serialization.cs @@ -53,21 +53,31 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WritePropertyName("productType"u8); writer.WriteStringValue(ProductType.Value.ToString()); } - if (options.Format != "W" && Optional.IsDefined(BillingStartOn)) - { - writer.WritePropertyName("billingStartDate"u8); - writer.WriteStringValue(BillingStartOn.Value, "O"); - } 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); @@ -130,9 +140,11 @@ internal static LicenseProfileMachineInstanceView DeserializeLicenseProfileMachi LicenseProfileMachineInstanceViewEsuProperties esuProfile = default; LicenseProfileSubscriptionStatus? subscriptionStatus = default; LicenseProfileProductType? productType = default; - DateTimeOffset? billingStartDate = default; DateTimeOffset? enrollmentDate = default; + DateTimeOffset? billingStartDate = default; DateTimeOffset? disenrollmentDate = default; + DateTimeOffset? billingEndDate = default; + ResponseError error = default; IList productFeatures = default; bool? softwareAssuranceCustomer = default; IDictionary serializedAdditionalRawData = default; @@ -189,22 +201,22 @@ internal static LicenseProfileMachineInstanceView DeserializeLicenseProfileMachi productType = new LicenseProfileProductType(property0.Value.GetString()); continue; } - if (property0.NameEquals("billingStartDate"u8)) + if (property0.NameEquals("enrollmentDate"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - billingStartDate = property0.Value.GetDateTimeOffset("O"); + enrollmentDate = property0.Value.GetDateTimeOffset("O"); continue; } - if (property0.NameEquals("enrollmentDate"u8)) + if (property0.NameEquals("billingStartDate"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - enrollmentDate = property0.Value.GetDateTimeOffset("O"); + billingStartDate = property0.Value.GetDateTimeOffset("O"); continue; } if (property0.NameEquals("disenrollmentDate"u8)) @@ -216,6 +228,24 @@ internal static LicenseProfileMachineInstanceView DeserializeLicenseProfileMachi disenrollmentDate = property0.Value.GetDateTimeOffset("O"); continue; } + if (property0.NameEquals("billingEndDate"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + billingEndDate = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("error"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = JsonSerializer.Deserialize(property0.Value.GetRawText()); + continue; + } if (property0.NameEquals("productFeatures"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -266,9 +296,11 @@ internal static LicenseProfileMachineInstanceView DeserializeLicenseProfileMachi esuProfile, subscriptionStatus, productType, - billingStartDate, enrollmentDate, + billingStartDate, disenrollmentDate, + billingEndDate, + error, productFeatures ?? new ChangeTrackingList(), softwareAssuranceCustomer, serializedAdditionalRawData); diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileMachineInstanceView.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileMachineInstanceView.cs index 72f385447c3ec..ded4ae467e2bb 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileMachineInstanceView.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileMachineInstanceView.cs @@ -57,22 +57,26 @@ public LicenseProfileMachineInstanceView() /// Properties for the Machine ESU profile. /// Indicates the subscription status of the product. /// Indicates the product type of the license. - /// The timestamp in UTC when the billing starts. /// 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. /// Specifies if this machine is licensed as part of a Software Assurance agreement. /// Keeps track of any properties unknown to the library. - internal LicenseProfileMachineInstanceView(HybridComputeLicenseStatus? licenseStatus, string licenseChannel, LicenseProfileMachineInstanceViewEsuProperties esuProfile, LicenseProfileSubscriptionStatus? subscriptionStatus, LicenseProfileProductType? productType, DateTimeOffset? billingStartOn, DateTimeOffset? enrollmentOn, DateTimeOffset? disenrollmentOn, IList productFeatures, bool? isSoftwareAssuranceCustomer, IDictionary serializedAdditionalRawData) + internal LicenseProfileMachineInstanceView(HybridComputeLicenseStatus? licenseStatus, string licenseChannel, LicenseProfileMachineInstanceViewEsuProperties esuProfile, LicenseProfileSubscriptionStatus? subscriptionStatus, LicenseProfileProductType? productType, DateTimeOffset? enrollmentOn, DateTimeOffset? billingStartOn, DateTimeOffset? disenrollmentOn, DateTimeOffset? billingEndOn, ResponseError error, IList productFeatures, bool? isSoftwareAssuranceCustomer, IDictionary serializedAdditionalRawData) { LicenseStatus = licenseStatus; LicenseChannel = licenseChannel; EsuProfile = esuProfile; SubscriptionStatus = subscriptionStatus; ProductType = productType; - BillingStartOn = billingStartOn; EnrollmentOn = enrollmentOn; + BillingStartOn = billingStartOn; DisenrollmentOn = disenrollmentOn; + BillingEndOn = billingEndOn; + Error = error; ProductFeatures = productFeatures; IsSoftwareAssuranceCustomer = isSoftwareAssuranceCustomer; _serializedAdditionalRawData = serializedAdditionalRawData; @@ -88,12 +92,16 @@ internal LicenseProfileMachineInstanceView(HybridComputeLicenseStatus? licenseSt public LicenseProfileSubscriptionStatus? SubscriptionStatus { get; set; } /// Indicates the product type of the license. public LicenseProfileProductType? ProductType { get; set; } - /// The timestamp in UTC when the billing starts. - public DateTimeOffset? BillingStartOn { get; } /// The timestamp in UTC when the user enrolls the feature. public DateTimeOffset? EnrollmentOn { get; } + /// The timestamp in UTC when the billing starts. + public DateTimeOffset? BillingStartOn { get; } /// The timestamp in UTC when the user disenrolled the feature. public DateTimeOffset? DisenrollmentOn { get; } + /// The timestamp in UTC when the billing ends. + public DateTimeOffset? BillingEndOn { get; } + /// The errors that were encountered during the feature enrollment or disenrollment. + public ResponseError Error { get; } /// The list of product features. public IList ProductFeatures { get; } /// Specifies if this machine is licensed as part of a Software Assurance agreement. diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileSubscriptionStatus.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileSubscriptionStatus.cs index ec9db89970d97..cee992a6ea2bc 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileSubscriptionStatus.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileSubscriptionStatus.cs @@ -26,6 +26,8 @@ public LicenseProfileSubscriptionStatus(string value) private const string EnablingValue = "Enabling"; private const string EnabledValue = "Enabled"; private const string DisabledValue = "Disabled"; + private const string DisablingValue = "Disabling"; + private const string FailedValue = "Failed"; /// Unknown. public static LicenseProfileSubscriptionStatus Unknown { get; } = new LicenseProfileSubscriptionStatus(UnknownValue); @@ -35,6 +37,10 @@ public LicenseProfileSubscriptionStatus(string value) public static LicenseProfileSubscriptionStatus Enabled { get; } = new LicenseProfileSubscriptionStatus(EnabledValue); /// Disabled. public static LicenseProfileSubscriptionStatus Disabled { get; } = new LicenseProfileSubscriptionStatus(DisabledValue); + /// Disabling. + public static LicenseProfileSubscriptionStatus Disabling { get; } = new LicenseProfileSubscriptionStatus(DisablingValue); + /// Failed. + public static LicenseProfileSubscriptionStatus Failed { get; } = new LicenseProfileSubscriptionStatus(FailedValue); /// Determines if two values are the same. public static bool operator ==(LicenseProfileSubscriptionStatus left, LicenseProfileSubscriptionStatus right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PatchSettingsStatus.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PatchSettingsStatus.Serialization.cs new file mode 100644 index 0000000000000..32016a8a77af9 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PatchSettingsStatus.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + public partial class PatchSettingsStatus : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatchSettingsStatus)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(HotpatchEnablementStatus)) + { + writer.WritePropertyName("hotpatchEnablementStatus"u8); + writer.WriteStringValue(HotpatchEnablementStatus.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + JsonSerializer.Serialize(writer, Error); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + PatchSettingsStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PatchSettingsStatus)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePatchSettingsStatus(document.RootElement, options); + } + + internal static PatchSettingsStatus DeserializePatchSettingsStatus(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + HotpatchEnablementStatus? hotpatchEnablementStatus = default; + ResponseError error = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("hotpatchEnablementStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + hotpatchEnablementStatus = new HotpatchEnablementStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PatchSettingsStatus(hotpatchEnablementStatus, error, 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(PatchSettingsStatus)} does not support writing '{options.Format}' format."); + } + } + + PatchSettingsStatus 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 DeserializePatchSettingsStatus(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PatchSettingsStatus)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PatchSettingsStatus.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PatchSettingsStatus.cs new file mode 100644 index 0000000000000..6b3be95978d19 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PatchSettingsStatus.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// Status of the hotpatch capability enrollment or disenrollment. + public partial class PatchSettingsStatus + { + /// + /// 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 PatchSettingsStatus() + { + } + + /// 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. + /// Keeps track of any properties unknown to the library. + internal PatchSettingsStatus(HotpatchEnablementStatus? hotpatchEnablementStatus, ResponseError error, IDictionary serializedAdditionalRawData) + { + HotpatchEnablementStatus = hotpatchEnablementStatus; + Error = error; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Indicates the current status of the hotpatch being enabled or disabled. + public HotpatchEnablementStatus? HotpatchEnablementStatus { get; } + /// The errors that were encountered during the hotpatch capability enrollment or disenrollment. + public ResponseError Error { get; } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/NetworkSecurityPerimeterConfigurationCollection.cs index de14566ad3502..cf2f12cba90ca 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-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -109,7 +109,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -154,7 +154,7 @@ public virtual Response Get(strin /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -184,7 +184,7 @@ public virtual AsyncPageable GetA /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -214,7 +214,7 @@ public virtual Pageable GetAll(Ca /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -257,7 +257,7 @@ public virtual async Task> ExistsAsync(string perimeterName, Canc /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -300,7 +300,7 @@ public virtual Response Exists(string perimeterName, CancellationToken can /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -345,7 +345,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs index 7d2de29e1b311..a5531384c3cef 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/NetworkSecurityPerimeterConfigurationResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-03-31-preview + /// 2024-05-20-preview /// /// /// Resource 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 791e837b4b2bd..535763209d97f 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-03-31-preview"; + _apiVersion = apiVersion ?? "2024-05-20-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 b3d6987a89417..6bbbeb1f28980 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-03-31-preview"; + _apiVersion = apiVersion ?? "2024-05-20-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 d7754ce50a084..174bfb4dad683 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/LicensesRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/LicensesRestOperations.cs @@ -32,7 +32,7 @@ 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-03-31-preview"; + _apiVersion = apiVersion ?? "2024-05-20-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 ba2d929698271..859dc15f190b8 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-03-31-preview"; + _apiVersion = apiVersion ?? "2024-05-20-preview"; _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/MachineRunCommandsRestOperations.cs index 5baabc84aeed3..6c4b4699cbafa 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/MachineRunCommandsRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/MachineRunCommandsRestOperations.cs @@ -32,7 +32,7 @@ public MachineRunCommandsRestOperations(HttpPipeline pipeline, string applicatio { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-03-31-preview"; + _apiVersion = apiVersion ?? "2024-05-20-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 8471e3125d021..41bc2768795c3 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/MachinesRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/MachinesRestOperations.cs @@ -32,7 +32,7 @@ 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-03-31-preview"; + _apiVersion = apiVersion ?? "2024-05-20-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 ca5ccb732bcd4..3ea8898f3dd0d 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-03-31-preview"; + _apiVersion = apiVersion ?? "2024-05-20-preview"; _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 c5f7208550d5e..a7759fbf7d493 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-03-31-preview"; + _apiVersion = apiVersion ?? "2024-05-20-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } 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 7dc11a05037fa..0fc03a5eb35fb 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-03-31-preview"; + _apiVersion = apiVersion ?? "2024-05-20-preview"; _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 ed3af8e54dacc..54c36e60cd944 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-03-31-preview"; + _apiVersion = apiVersion ?? "2024-05-20-preview"; _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 7efa0b753b63d..157e2039387bd 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-03-31-preview"; + _apiVersion = apiVersion ?? "2024-05-20-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md index 540ed193ea88a..d06d2db00ddc5 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md @@ -8,7 +8,7 @@ azure-arm: true csharp: true library-name: HybridCompute namespace: Azure.ResourceManager.HybridCompute -require: https://github.com/Azure/azure-rest-api-specs/blob/5f0ca7e524c788be5f2b7e7488076dadba7b26ce/specification/hybridcompute/resource-manager/readme.md +require: https://github.com/Azure/azure-rest-api-specs/blob/d15d528c272bda96ecee82003d06998ca1efea4f/specification/hybridcompute/resource-manager/readme.md #tag: package-preview-2024-03 output-folder: $(this-folder)/Generated clear-output-folder: true @@ -275,8 +275,6 @@ directive: - remove-operation: NetworkConfigurations_Update - remove-operation: NetworkConfigurations_CreateOrUpdate - - remove-operation: NetworkSecurityPerimeterConfigurations_ReconcileForPrivateLinkScope - # we will generate a seperate SDK for them - remove-operation: Gateways_CreateOrUpdate - remove-operation: Gateways_Get From 182527d65ba64025073ae966701779e78ec4eb8e Mon Sep 17 00:00:00 2001 From: Yao Tong Date: Wed, 19 Jun 2024 14:59:01 -0400 Subject: [PATCH 2/8] add gateway and setting commands --- .../Samples/Sample_GatewayCollection.cs | 204 +++++ .../Samples/Sample_GatewayResource.cs | 147 ++++ .../Sample_ResourceGroupResourceExtensions.cs | 53 ++ .../Generated/ArmHybridComputeModelFactory.cs | 53 ++ .../Extensions/HybridComputeExtensions.cs | 258 +++++++ .../MockableHybridComputeArmClient.cs | 12 + ...kableHybridComputeResourceGroupResource.cs | 171 ++++ ...ckableHybridComputeSubscriptionResource.cs | 64 ++ .../src/Generated/GatewayCollection.cs | 494 ++++++++++++ .../Generated/GatewayData.Serialization.cs | 299 +++++++ .../src/Generated/GatewayData.cs | 100 +++ .../GatewayResource.Serialization.cs | 26 + .../src/Generated/GatewayResource.cs | 699 +++++++++++++++++ .../HybridComputeExtensionValueData.cs | 2 +- .../GatewayOperationSource.cs | 38 + .../Models/GatewayPatch.Serialization.cs | 177 +++++ .../src/Generated/Models/GatewayPatch.cs | 34 + .../src/Generated/Models/GatewayType.cs | 48 ++ .../GatewaysListResult.Serialization.cs | 140 ++++ .../Generated/Models/GatewaysListResult.cs | 80 ++ .../Models/Settings.Serialization.cs | 227 ++++++ .../src/Generated/Models/Settings.cs | 75 ++ .../RestOperations/GatewaysRestOperations.cs | 731 ++++++++++++++++++ .../RestOperations/SettingsRestOperations.cs | 165 ++++ .../src/autorest.md | 23 +- 25 files changed, 4297 insertions(+), 23 deletions(-) create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_GatewayCollection.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_GatewayResource.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/GatewayCollection.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/GatewayData.Serialization.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/GatewayData.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/GatewayResource.Serialization.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/GatewayResource.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/GatewayOperationSource.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewayPatch.Serialization.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewayPatch.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewayType.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewaysListResult.Serialization.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewaysListResult.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/Settings.Serialization.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/Settings.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/GatewaysRestOperations.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/SettingsRestOperations.cs diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_GatewayCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_GatewayCollection.cs new file mode 100644 index 0000000000000..99c0a99550eb7 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_GatewayCollection.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.HybridCompute.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.HybridCompute.Samples +{ + public partial class Sample_GatewayCollection + { + // 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 GatewayResource + GatewayCollection collection = resourceGroupResource.GetGateways(); + + // invoke the operation + string gatewayName = "{gatewayName}"; + GatewayData data = new GatewayData(new AzureLocation("eastus2euap")) + { + GatewayType = GatewayType.Public, + AllowedFeatures = +{ +"*" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, gatewayName, data); + GatewayResource 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 + GatewayData 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 GatewayResource + GatewayCollection collection = resourceGroupResource.GetGateways(); + + // invoke the operation + string gatewayName = "{gatewayName}"; + GatewayResource 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 + GatewayData 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 GatewayResource + GatewayCollection collection = resourceGroupResource.GetGateways(); + + // 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 GatewayResource + GatewayCollection collection = resourceGroupResource.GetGateways(); + + // invoke the operation + string gatewayName = "{gatewayName}"; + NullableResponse response = await collection.GetIfExistsAsync(gatewayName); + GatewayResource 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 + GatewayData 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 GatewayResource + GatewayCollection collection = resourceGroupResource.GetGateways(); + + // invoke the operation and iterate over the result + await foreach (GatewayResource 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 + GatewayData 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_GatewayResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_GatewayResource.cs new file mode 100644 index 0000000000000..2c9d6ab0e8002 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_GatewayResource.cs @@ -0,0 +1,147 @@ +// 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_GatewayResource + { + // 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 GatewayResource created on azure + // for more information of creating GatewayResource, please refer to the document of GatewayResource + string subscriptionId = "ffd506c8-3415-42d3-9612-fdb423fb17df"; + string resourceGroupName = "myResourceGroup"; + string gatewayName = "{gatewayName}"; + ResourceIdentifier gatewayResourceId = GatewayResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, gatewayName); + GatewayResource gateway = client.GetGatewayResource(gatewayResourceId); + + // invoke the operation + GatewayPatch patch = new GatewayPatch() + { + AllowedFeatures = +{ +"*" +}, + }; + GatewayResource result = await gateway.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 + GatewayData 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 GatewayResource created on azure + // for more information of creating GatewayResource, please refer to the document of GatewayResource + string subscriptionId = "ffd506c8-3415-42d3-9612-fdb423fb17df"; + string resourceGroupName = "myResourceGroup"; + string gatewayName = "{gatewayName}"; + ResourceIdentifier gatewayResourceId = GatewayResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, gatewayName); + GatewayResource gateway = client.GetGatewayResource(gatewayResourceId); + + // invoke the operation + GatewayResource result = await gateway.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 + GatewayData 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 GatewayResource created on azure + // for more information of creating GatewayResource, please refer to the document of GatewayResource + string subscriptionId = "ffd506c8-3415-42d3-9612-fdb423fb17df"; + string resourceGroupName = "myResourceGroup"; + string gatewayName = "{gatewayName}"; + ResourceIdentifier gatewayResourceId = GatewayResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, gatewayName); + GatewayResource gateway = client.GetGatewayResource(gatewayResourceId); + + // invoke the operation + await gateway.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 GetGateways_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 (GatewayResource item in subscriptionResource.GetGatewaysAsync()) + { + // 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 + GatewayData 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_ResourceGroupResourceExtensions.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs new file mode 100644 index 0000000000000..87dc3641ad584 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs @@ -0,0 +1,53 @@ +// 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 UpdateSetting_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"; + Settings settings = new Settings() + { + GatewayResourceId = new ResourceIdentifier("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/gateways/newGateway"), + }; + Settings result = await resourceGroupResource.UpdateSettingAsync(baseProvider, baseResourceType, baseResourceName, settingsResourceName, settings); + + 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 84ee05d554373..45d590f3f5857 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArmHybridComputeModelFactory.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArmHybridComputeModelFactory.cs @@ -692,6 +692,59 @@ public static ExtensionsResourceStatus ExtensionsResourceStatus(string code = nu 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 GatewayData GatewayData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, HybridComputeProvisioningState? provisioningState = null, string gatewayId = null, GatewayType? gatewayType = null, string gatewayEndpoint = null, IEnumerable allowedFeatures = null) + { + tags ??= new Dictionary(); + allowedFeatures ??= new List(); + + return new GatewayData( + 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 Settings Settings(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, Guid? tenantId = null, ResourceIdentifier gatewayResourceId = null) + { + return new Settings( + id, + name, + resourceType, + systemData, + tenantId, + gatewayResourceId, + serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. 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 89c0b18a38a86..fbb24d5d17eab 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/HybridComputeExtensions.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/HybridComputeExtensions.cs @@ -128,6 +128,25 @@ public static MachineRunCommandResource GetMachineRunCommandResource(this ArmCli return GetMockableHybridComputeArmClient(client).GetMachineRunCommandResource(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 GatewayResource GetGatewayResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableHybridComputeArmClient(client).GetGatewayResource(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. @@ -392,6 +411,99 @@ public static Response GetHybridComputeMachine(thi return GetMockableHybridComputeResourceGroupResource(resourceGroupResource).GetHybridComputeMachine(machineName, expand, cancellationToken); } + /// + /// Gets a collection of GatewayResources 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 GatewayResources and their operations over a GatewayResource. + public static GatewayCollection GetGateways(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableHybridComputeResourceGroupResource(resourceGroupResource).GetGateways(); + } + + /// + /// 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> GetGatewayAsync(this ResourceGroupResource resourceGroupResource, string gatewayName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableHybridComputeResourceGroupResource(resourceGroupResource).GetGatewayAsync(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 GetGateway(this ResourceGroupResource resourceGroupResource, string gatewayName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableHybridComputeResourceGroupResource(resourceGroupResource).GetGateway(gatewayName, cancellationToken); + } + /// /// Gets a collection of HybridComputePrivateLinkScopeResources in the ResourceGroupResource. /// @@ -485,6 +597,80 @@ 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> UpdateSettingAsync(this ResourceGroupResource resourceGroupResource, string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, Settings settings, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableHybridComputeResourceGroupResource(resourceGroupResource).UpdateSettingAsync(baseProvider, baseResourceType, baseResourceName, settingsResourceName, settings, 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 UpdateSetting(this ResourceGroupResource resourceGroupResource, string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, Settings settings, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableHybridComputeResourceGroupResource(resourceGroupResource).UpdateSetting(baseProvider, baseResourceType, baseResourceName, settingsResourceName, settings, cancellationToken); + } + /// /// Gets a collection of HybridComputeExtensionValueResources in the SubscriptionResource. /// @@ -732,6 +918,78 @@ public static Pageable GetHybridComputeMachines(th return GetMockableHybridComputeSubscriptionResource(subscriptionResource).GetHybridComputeMachines(cancellationToken); } + /// + /// The operation to get all gateways of a non-Azure machine + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/gateways + /// + /// + /// Operation Id + /// Gateways_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-05-20-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetGatewaysAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableHybridComputeSubscriptionResource(subscriptionResource).GetGatewaysAsync(cancellationToken); + } + + /// + /// The operation to get all gateways of a non-Azure machine + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/gateways + /// + /// + /// Operation Id + /// Gateways_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-05-20-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetGateways(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableHybridComputeSubscriptionResource(subscriptionResource).GetGateways(cancellationToken); + } + /// /// Gets a list of all Azure Arc PrivateLinkScopes within a subscription. /// 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 a5edff4a546b8..5f0ffd9feca0d 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeArmClient.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeArmClient.cs @@ -94,6 +94,18 @@ public virtual MachineRunCommandResource GetMachineRunCommandResource(ResourceId 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 GatewayResource GetGatewayResource(ResourceIdentifier id) + { + GatewayResource.ValidateResourceId(id); + return new GatewayResource(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 fa1ed656da0f6..bf54be14c0e30 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeResourceGroupResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeResourceGroupResource.cs @@ -9,12 +9,17 @@ 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() { @@ -27,6 +32,9 @@ 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); @@ -173,6 +181,75 @@ public virtual Response GetHybridComputeMachine(st return GetHybridComputeMachines().Get(machineName, expand, cancellationToken); } + /// Gets a collection of GatewayResources in the ResourceGroupResource. + /// An object representing collection of GatewayResources and their operations over a GatewayResource. + public virtual GatewayCollection GetGateways() + { + return GetCachedClient(client => new GatewayCollection(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> GetGatewayAsync(string gatewayName, CancellationToken cancellationToken = default) + { + return await GetGateways().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 GetGateway(string gatewayName, CancellationToken cancellationToken = default) + { + return GetGateways().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() @@ -241,5 +318,99 @@ 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> UpdateSettingAsync(string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, Settings settings, 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(settings, nameof(settings)); + + using var scope = SettingsClientDiagnostics.CreateScope("MockableHybridComputeResourceGroupResource.UpdateSetting"); + scope.Start(); + try + { + var response = await SettingsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, baseProvider, baseResourceType, baseResourceName, settingsResourceName, settings, 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 UpdateSetting(string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, Settings settings, 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(settings, nameof(settings)); + + using var scope = SettingsClientDiagnostics.CreateScope("MockableHybridComputeResourceGroupResource.UpdateSetting"); + scope.Start(); + try + { + var response = SettingsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, baseProvider, baseResourceType, baseResourceName, settingsResourceName, settings, 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 d4de7ae01762b..69727cdfe8a65 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeSubscriptionResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeSubscriptionResource.cs @@ -22,6 +22,8 @@ public partial class MockableHybridComputeSubscriptionResource : ArmResource private LicensesRestOperations _hybridComputeLicenseLicensesRestClient; private ClientDiagnostics _hybridComputeMachineMachinesClientDiagnostics; private MachinesRestOperations _hybridComputeMachineMachinesRestClient; + private ClientDiagnostics _gatewayClientDiagnostics; + private GatewaysRestOperations _gatewayRestClient; private ClientDiagnostics _hybridComputePrivateLinkScopePrivateLinkScopesClientDiagnostics; private PrivateLinkScopesRestOperations _hybridComputePrivateLinkScopePrivateLinkScopesRestClient; @@ -41,6 +43,8 @@ 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 GatewayClientDiagnostics => _gatewayClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.HybridCompute", GatewayResource.ResourceType.Namespace, Diagnostics); + private GatewaysRestOperations GatewayRestClient => _gatewayRestClient ??= new GatewaysRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(GatewayResource.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)); @@ -250,6 +254,66 @@ public virtual Pageable GetHybridComputeMachines(C return GeneratorPageableHelpers.CreatePageable(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 + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/gateways + /// + /// + /// Operation Id + /// Gateways_ListBySubscription + /// + /// + /// 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 GetGatewaysAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => GatewayRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => GatewayRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new GatewayResource(Client, GatewayData.DeserializeGatewayData(e)), GatewayClientDiagnostics, Pipeline, "MockableHybridComputeSubscriptionResource.GetGateways", "value", "nextLink", cancellationToken); + } + + /// + /// The operation to get all gateways of a non-Azure machine + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.HybridCompute/gateways + /// + /// + /// Operation Id + /// Gateways_ListBySubscription + /// + /// + /// 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 GetGateways(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => GatewayRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => GatewayRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new GatewayResource(Client, GatewayData.DeserializeGatewayData(e)), GatewayClientDiagnostics, Pipeline, "MockableHybridComputeSubscriptionResource.GetGateways", "value", "nextLink", cancellationToken); + } + /// /// Gets a list of all Azure Arc PrivateLinkScopes within a subscription. /// diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/GatewayCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/GatewayCollection.cs new file mode 100644 index 0000000000000..d528b12455fdd --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/GatewayCollection.cs @@ -0,0 +1,494 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.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 GetGateways method from an instance of . + /// + public partial class GatewayCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _gatewayClientDiagnostics; + private readonly GatewaysRestOperations _gatewayRestClient; + + /// Initializes a new instance of the class for mocking. + protected GatewayCollection() + { + } + + /// 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 GatewayCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _gatewayClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridCompute", GatewayResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(GatewayResource.ResourceType, out string gatewayApiVersion); + _gatewayRestClient = new GatewaysRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, gatewayApiVersion); +#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, GatewayData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _gatewayClientDiagnostics.CreateScope("GatewayCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _gatewayRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, data, cancellationToken).ConfigureAwait(false); + var operation = new HybridComputeArmOperation(new GatewayOperationSource(Client), _gatewayClientDiagnostics, Pipeline, _gatewayRestClient.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, GatewayData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _gatewayClientDiagnostics.CreateScope("GatewayCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _gatewayRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, data, cancellationToken); + var operation = new HybridComputeArmOperation(new GatewayOperationSource(Client), _gatewayClientDiagnostics, Pipeline, _gatewayRestClient.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 = _gatewayClientDiagnostics.CreateScope("GatewayCollection.Get"); + scope.Start(); + try + { + var response = await _gatewayRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new GatewayResource(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 = _gatewayClientDiagnostics.CreateScope("GatewayCollection.Get"); + scope.Start(); + try + { + var response = _gatewayRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new GatewayResource(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) => _gatewayRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _gatewayRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new GatewayResource(Client, GatewayData.DeserializeGatewayData(e)), _gatewayClientDiagnostics, Pipeline, "GatewayCollection.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) => _gatewayRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _gatewayRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new GatewayResource(Client, GatewayData.DeserializeGatewayData(e)), _gatewayClientDiagnostics, Pipeline, "GatewayCollection.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 = _gatewayClientDiagnostics.CreateScope("GatewayCollection.Exists"); + scope.Start(); + try + { + var response = await _gatewayRestClient.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 = _gatewayClientDiagnostics.CreateScope("GatewayCollection.Exists"); + scope.Start(); + try + { + var response = _gatewayRestClient.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 = _gatewayClientDiagnostics.CreateScope("GatewayCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _gatewayRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new GatewayResource(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 = _gatewayClientDiagnostics.CreateScope("GatewayCollection.GetIfExists"); + scope.Start(); + try + { + var response = _gatewayRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new GatewayResource(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/GatewayData.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/GatewayData.Serialization.cs new file mode 100644 index 0000000000000..43f170114d0f9 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/GatewayData.Serialization.cs @@ -0,0 +1,299 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.HybridCompute.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.HybridCompute +{ + public partial class GatewayData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GatewayData)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W") + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ResourceType); + } + if (options.Format != "W" && Optional.IsDefined(SystemData)) + { + writer.WritePropertyName("systemData"u8); + JsonSerializer.Serialize(writer, SystemData); + } + 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(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + GatewayData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GatewayData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGatewayData(document.RootElement, options); + } + + internal static GatewayData DeserializeGatewayData(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; + GatewayType? 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 GatewayType(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 GatewayData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + provisioningState, + gatewayId, + gatewayType, + gatewayEndpoint, + allowedFeatures ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GatewayData)} does not support writing '{options.Format}' format."); + } + } + + GatewayData 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 DeserializeGatewayData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GatewayData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/GatewayData.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/GatewayData.cs new file mode 100644 index 0000000000000..fbefd7394535c --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/GatewayData.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.HybridCompute.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.HybridCompute +{ + /// + /// A class representing the Gateway data model. + /// Describes an Arc Gateway. + /// + public partial class GatewayData : 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 GatewayData(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 GatewayData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, HybridComputeProvisioningState? provisioningState, string gatewayId, GatewayType? 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 GatewayData() + { + } + + /// The provisioning state, which only appears in the response. + public HybridComputeProvisioningState? ProvisioningState { get; } + /// A unique, immutable, identifier for the Gateway. + public string GatewayId { get; } + /// The type of the Gateway resource. + public GatewayType? GatewayType { get; set; } + /// The endpoint fqdn for the Gateway. + public string GatewayEndpoint { get; } + /// Specifies the list of features that are enabled for this Gateway. + public IList AllowedFeatures { get; } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/GatewayResource.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/GatewayResource.Serialization.cs new file mode 100644 index 0000000000000..d83a53461866f --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/GatewayResource.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 GatewayResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + GatewayData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + GatewayData 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/GatewayResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/GatewayResource.cs new file mode 100644 index 0000000000000..f7184b6992d34 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/GatewayResource.cs @@ -0,0 +1,699 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.HybridCompute.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.HybridCompute +{ + /// + /// A Class representing a Gateway 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 GetGatewayResource method. + /// Otherwise you can get one from its parent resource using the GetGateway method. + /// + public partial class GatewayResource : 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 _gatewayClientDiagnostics; + private readonly GatewaysRestOperations _gatewayRestClient; + private readonly GatewayData _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 GatewayResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal GatewayResource(ArmClient client, GatewayData 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 GatewayResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _gatewayClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridCompute", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string gatewayApiVersion); + _gatewayRestClient = new GatewaysRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, gatewayApiVersion); +#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 GatewayData 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 = _gatewayClientDiagnostics.CreateScope("GatewayResource.Get"); + scope.Start(); + try + { + var response = await _gatewayRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new GatewayResource(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 = _gatewayClientDiagnostics.CreateScope("GatewayResource.Get"); + scope.Start(); + try + { + var response = _gatewayRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new GatewayResource(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 = _gatewayClientDiagnostics.CreateScope("GatewayResource.Delete"); + scope.Start(); + try + { + var response = await _gatewayRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new HybridComputeArmOperation(_gatewayClientDiagnostics, Pipeline, _gatewayRestClient.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 = _gatewayClientDiagnostics.CreateScope("GatewayResource.Delete"); + scope.Start(); + try + { + var response = _gatewayRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new HybridComputeArmOperation(_gatewayClientDiagnostics, Pipeline, _gatewayRestClient.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(GatewayPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _gatewayClientDiagnostics.CreateScope("GatewayResource.Update"); + scope.Start(); + try + { + var response = await _gatewayRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new GatewayResource(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(GatewayPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _gatewayClientDiagnostics.CreateScope("GatewayResource.Update"); + scope.Start(); + try + { + var response = _gatewayRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + return Response.FromValue(new GatewayResource(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 = _gatewayClientDiagnostics.CreateScope("GatewayResource.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 _gatewayRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new GatewayResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new GatewayPatch(); + 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 = _gatewayClientDiagnostics.CreateScope("GatewayResource.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 = _gatewayRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new GatewayResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new GatewayPatch(); + 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 = _gatewayClientDiagnostics.CreateScope("GatewayResource.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 _gatewayRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new GatewayResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new GatewayPatch(); + 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 = _gatewayClientDiagnostics.CreateScope("GatewayResource.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 = _gatewayRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new GatewayResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new GatewayPatch(); + 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 = _gatewayClientDiagnostics.CreateScope("GatewayResource.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 _gatewayRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new GatewayResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new GatewayPatch(); + 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 = _gatewayClientDiagnostics.CreateScope("GatewayResource.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 = _gatewayRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new GatewayResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new GatewayPatch(); + 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/HybridComputeExtensionValueData.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeExtensionValueData.cs index f37407fdbb7c3..483a2c91bf1f0 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 . - internal HybridComputeExtensionValueData() + public HybridComputeExtensionValueData() { } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/GatewayOperationSource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/GatewayOperationSource.cs new file mode 100644 index 0000000000000..4d392372766bf --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/GatewayOperationSource.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 GatewayOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal GatewayOperationSource(ArmClient client) + { + _client = client; + } + + GatewayResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = GatewayData.DeserializeGatewayData(document.RootElement); + return new GatewayResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = GatewayData.DeserializeGatewayData(document.RootElement); + return new GatewayResource(_client, data); + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewayPatch.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewayPatch.Serialization.cs new file mode 100644 index 0000000000000..7f4d1446e4c0f --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewayPatch.Serialization.cs @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + public partial class GatewayPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GatewayPatch)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(AllowedFeatures)) + { + writer.WritePropertyName("allowedFeatures"u8); + writer.WriteStartArray(); + foreach (var item in AllowedFeatures) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + GatewayPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GatewayPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGatewayPatch(document.RootElement, options); + } + + internal static GatewayPatch DeserializeGatewayPatch(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 GatewayPatch(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(GatewayPatch)} does not support writing '{options.Format}' format."); + } + } + + GatewayPatch 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 DeserializeGatewayPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GatewayPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewayPatch.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewayPatch.cs new file mode 100644 index 0000000000000..d4e2003431263 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewayPatch.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// Describes a License Update. + public partial class GatewayPatch : HybridComputeResourceUpdate + { + /// Initializes a new instance of . + public GatewayPatch() + { + 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 GatewayPatch(IDictionary tags, IDictionary serializedAdditionalRawData, IList allowedFeatures) : base(tags, serializedAdditionalRawData) + { + AllowedFeatures = allowedFeatures; + } + + /// Specifies the list of features that are enabled for this Gateway. + public IList AllowedFeatures { get; } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewayType.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewayType.cs new file mode 100644 index 0000000000000..006ab6207e9ff --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewayType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// The type of the Gateway resource. + public readonly partial struct GatewayType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public GatewayType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PublicValue = "Public"; + + /// Public. + public static GatewayType Public { get; } = new GatewayType(PublicValue); + /// Determines if two values are the same. + public static bool operator ==(GatewayType left, GatewayType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(GatewayType left, GatewayType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator GatewayType(string value) => new GatewayType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is GatewayType other && Equals(other); + /// + public bool Equals(GatewayType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 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/GatewaysListResult.Serialization.cs new file mode 100644 index 0000000000000..04ef8275cff3c --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewaysListResult.Serialization.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + internal partial class GatewaysListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GatewaysListResult)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + 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 + } + } + writer.WriteEndObject(); + } + + GatewaysListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + 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."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGatewaysListResult(document.RootElement, options); + } + + internal static GatewaysListResult DeserializeGatewaysListResult(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)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(GatewayData.DeserializeGatewayData(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 GatewaysListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GatewaysListResult)} does not support writing '{options.Format}' format."); + } + } + + GatewaysListResult 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 DeserializeGatewaysListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GatewaysListResult)} does not support reading '{options.Format}' format."); + } + } + + 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/GatewaysListResult.cs new file mode 100644 index 0000000000000..2f0b0d73e8d7c --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewaysListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// The List license operation response. + internal partial class GatewaysListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The list of Gateways. + /// is null. + internal GatewaysListResult(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. + /// Keeps track of any properties unknown to the library. + internal GatewaysListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal GatewaysListResult() + { + } + + /// 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. + public string NextLink { get; } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/Settings.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/Settings.Serialization.cs new file mode 100644 index 0000000000000..64a4d551cc844 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/Settings.Serialization.cs @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + public partial class Settings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Settings)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W") + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ResourceType); + } + if (options.Format != "W" && Optional.IsDefined(SystemData)) + { + writer.WritePropertyName("systemData"u8); + JsonSerializer.Serialize(writer, SystemData); + } + 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(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + Settings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Settings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSettings(document.RootElement, options); + } + + internal static Settings DeserializeSettings(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 Settings( + id, + name, + type, + systemData, + tenantId, + gatewayResourceId, + 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(Settings)} does not support writing '{options.Format}' format."); + } + } + + Settings 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 DeserializeSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Settings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/Settings.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/Settings.cs new file mode 100644 index 0000000000000..b43d85e63eff0 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/Settings.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + /// The Settings. + public partial class Settings : 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 Settings() + { + } + + /// 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 Settings(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. + public Guid? TenantId { get; } + /// Associated Gateway Resource Id. + public ResourceIdentifier GatewayResourceId { get; set; } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/GatewaysRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/GatewaysRestOperations.cs new file mode 100644 index 0000000000000..4331b0614cef2 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/GatewaysRestOperations.cs @@ -0,0 +1,731 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.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, GatewayData 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, GatewayData 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, GatewayData 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, GatewayData 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, GatewayPatch 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, GatewayPatch 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, GatewayPatch 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: + { + GatewayData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = GatewayData.DeserializeGatewayData(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, GatewayPatch 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: + { + GatewayData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = GatewayData.DeserializeGatewayData(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: + { + GatewayData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = GatewayData.DeserializeGatewayData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((GatewayData)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: + { + GatewayData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = GatewayData.DeserializeGatewayData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((GatewayData)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/SettingsRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/SettingsRestOperations.cs new file mode 100644 index 0000000000000..a437cc66502c1 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/SettingsRestOperations.cs @@ -0,0 +1,165 @@ +// 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, Settings settings) + { + 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, Settings settings) + { + 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(settings, 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, Settings settings, 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(settings, nameof(settings)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, baseProvider, baseResourceType, baseResourceName, settingsResourceName, settings); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + Settings value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = Settings.DeserializeSettings(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, Settings settings, 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(settings, nameof(settings)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, baseProvider, baseResourceType, baseResourceName, settingsResourceName, settings); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + Settings value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = Settings.DeserializeSettings(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 d06d2db00ddc5..9e01b5a16ae95 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md @@ -244,15 +244,6 @@ directive: } } - # remove cmdlets - - where: - subject: NetworkProfile - remove: true - - where: - subject: MachineRunCommand - verb: Set - remove: true - # remove operations - remove-operation: Machines_CreateOrUpdate - remove-operation: MachineRunCommands_Update @@ -261,7 +252,7 @@ directive: - remove-operation: HybridIdentityMetadata_Get - remove-operation: HybridIdentityMetadata_ListByMachines - # add back when swagger change is checked in + # we don't want user to interact with them - remove-operation: Licenses_ValidateLicense - remove-operation: Licenses_Update #PATCH @@ -271,18 +262,6 @@ directive: - remove-operation: LicenseProfiles_List - remove-operation: LicenseProfiles_CreateOrUpdate - - remove-operation: NetworkConfigurations_Get - - remove-operation: NetworkConfigurations_Update - - remove-operation: NetworkConfigurations_CreateOrUpdate - - # we will generate a seperate SDK for them - - remove-operation: Gateways_CreateOrUpdate - - remove-operation: Gateways_Get - - remove-operation: Gateways_ListByResourceGroup - - remove-operation: Gateways_ListBySubscription - - remove-operation: Gateways_Delete - - remove-operation: Gateways_Update - - remove-operation: Settings_Update - remove-operation: Settings_Get - remove-operation: Settings_Patch From 29419b6aa6aaa46c57e2a95fc27063b7b3d02b3b Mon Sep 17 00:00:00 2001 From: Yao Tong Date: Wed, 19 Jun 2024 16:16:05 -0400 Subject: [PATCH 3/8] update readme --- .../src/autorest.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md index 9e01b5a16ae95..65cf2f14fd02c 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/d15d528c272bda96ecee82003d06998ca1efea4f/specification/hybridcompute/resource-manager/readme.md -#tag: package-preview-2024-03 +require: https://github.com/Azure/azure-rest-api-specs/blob/b48d5d72073a296514d3d4db77887d8711526ccc/specification/hybridcompute/resource-manager/readme.md +#tag: package-preview-2024-05 output-folder: $(this-folder)/Generated clear-output-folder: true sample-gen: @@ -244,15 +244,13 @@ directive: } } - # remove operations - - remove-operation: Machines_CreateOrUpdate - - remove-operation: MachineRunCommands_Update + # we don't want user to interact with them / we don't support some operations + - remove-operation: MachineRunCommands_Update #PATCH - remove-operation: AgentVersion_List - remove-operation: AgentVersion_Get - remove-operation: HybridIdentityMetadata_Get - remove-operation: HybridIdentityMetadata_ListByMachines - # we don't want user to interact with them - remove-operation: Licenses_ValidateLicense - remove-operation: Licenses_Update #PATCH From dfadfe053f6cedaba48370a44127dfa6d5eec13a Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Fri, 5 Jul 2024 16:04:45 +0800 Subject: [PATCH 4/8] update --- .../CHANGELOG.md | 24 +- ...rceManager.HybridCompute.netstandard2.0.cs | 163 +++- ... Sample_HybridComputeGatewayCollection.cs} | 46 +- ...=> Sample_HybridComputeGatewayResource.cs} | 44 +- .../Sample_HybridComputeMachineResource.cs | 2 +- .../Sample_ResourceGroupResourceExtensions.cs | 6 +- .../Generated/ArmHybridComputeModelFactory.cs | 36 +- .../Extensions/HybridComputeExtensions.cs | 78 +- .../MockableHybridComputeArmClient.cs | 12 +- ...kableHybridComputeResourceGroupResource.cs | 44 +- ...ckableHybridComputeSubscriptionResource.cs | 32 +- .../Generated/GatewayData.Serialization.cs | 299 ------- .../GatewayResource.Serialization.cs | 26 - ...ComputeExtensionValueData.Serialization.cs | 143 ++++ .../HybridComputeExtensionValueData.cs | 3 + ...n.cs => HybridComputeGatewayCollection.cs} | 130 +-- .../HybridComputeGatewayData.Serialization.cs | 535 ++++++++++++ ...wayData.cs => HybridComputeGatewayData.cs} | 23 +- ...ridComputeGatewayResource.Serialization.cs | 26 + ...rce.cs => HybridComputeGatewayResource.cs} | 166 ++-- .../HybridComputeLicenseData.Serialization.cs | 184 ++++ .../src/Generated/HybridComputeLicenseData.cs | 4 + .../HybridComputeMachineData.Serialization.cs | 803 ++++++++++++++++++ .../src/Generated/HybridComputeMachineData.cs | 34 + ...mputeMachineExtensionData.Serialization.cs | 136 +++ .../HybridComputeMachineExtensionData.cs | 1 + ...ateEndpointConnectionData.Serialization.cs | 86 ++ ...ridComputePrivateEndpointConnectionData.cs | 1 + ...tePrivateLinkResourceData.Serialization.cs | 86 ++ .../HybridComputePrivateLinkResourceData.cs | 1 + ...mputePrivateLinkScopeData.Serialization.cs | 136 +++ .../HybridComputePrivateLinkScopeData.cs | 1 + .../Internal/BicepSerializationHelpers.cs | 58 ++ .../Generated/Internal/WirePathAttribute.cs | 27 + .../GatewayOperationSource.cs | 38 - .../HybridComputeGatewayOperationSource.cs | 38 + .../MachineRunCommandData.Serialization.cs | 360 ++++++++ .../src/Generated/MachineRunCommandData.cs | 13 + .../AgentConfiguration.Serialization.cs | 213 +++++ .../Generated/Models/AgentConfiguration.cs | 8 + .../Models/AgentUpgrade.Serialization.cs | 149 ++++ .../src/Generated/Models/AgentUpgrade.cs | 7 + ...atchCountByClassification.Serialization.cs | 153 ++++ .../AvailablePatchCountByClassification.cs | 9 + .../Generated/Models/EsuKey.Serialization.cs | 56 ++ .../src/Generated/Models/EsuKey.cs | 2 + .../Models/ExtensionTargetProperties.cs | 1 + .../ExtensionValueListResult.Serialization.cs | 42 + .../ExtensionsResourceStatus.Serialization.cs | 118 +++ .../Models/ExtensionsResourceStatus.cs | 5 + .../src/Generated/Models/GatewayType.cs | 48 -- .../GatewaysListResult.Serialization.cs | 71 +- .../Generated/Models/GatewaysListResult.cs | 6 +- .../Models/HotpatchEnablementStatus.cs | 2 +- .../HybridComputeAccessRule.Serialization.cs | 96 +++ .../Models/HybridComputeAccessRule.cs | 3 + ...ybridComputeCloudMetadata.Serialization.cs | 41 + .../Models/HybridComputeCloudMetadata.cs | 1 + ...uteConfigurationExtension.Serialization.cs | 64 ++ .../HybridComputeConfigurationExtension.cs | 2 + ...idComputeConnectionDetail.Serialization.cs | 125 +++ .../Models/HybridComputeConnectionDetail.cs | 5 + ...ybridComputeGatewayPatch.Serialization.cs} | 38 +- ...yPatch.cs => HybridComputeGatewayPatch.cs} | 11 +- .../Models/HybridComputeGatewayType.cs | 48 ++ .../HybridComputeIPAddress.Serialization.cs | 82 ++ .../Models/HybridComputeIPAddress.cs | 3 + ...bridComputeLicenseDetails.Serialization.cs | 155 ++++ .../Models/HybridComputeLicenseDetails.cs | 8 + ...ComputeLinuxConfiguration.Serialization.cs | 90 +- .../Models/HybridComputeLinuxConfiguration.cs | 14 +- .../Models/HybridComputeLinuxParameters.cs | 3 + .../HybridComputeLocation.Serialization.cs | 110 +++ .../Generated/Models/HybridComputeLocation.cs | 4 + .../HybridComputeMachineExtensionPatch.cs | 8 + .../Models/HybridComputeMachinePatch.cs | 8 + ...idComputeNetworkInterface.Serialization.cs | 42 + .../Models/HybridComputeNetworkInterface.cs | 1 + ...bridComputeNetworkProfile.Serialization.cs | 42 + .../Models/HybridComputeNetworkProfile.cs | 1 + .../HybridComputeOSProfile.Serialization.cs | 71 ++ .../Models/HybridComputeOSProfile.cs | 3 + ...omputePatchSettingsStatus.Serialization.cs | 189 +++++ ...cs => HybridComputePatchSettingsStatus.cs} | 12 +- ...pointConnectionListResult.Serialization.cs | 65 ++ ...pointConnectionProperties.Serialization.cs | 111 +++ ...putePrivateEndpointConnectionProperties.cs | 4 + ...ateLinkResourceListResult.Serialization.cs | 65 ++ ...ateLinkResourceProperties.Serialization.cs | 114 +++ ...ridComputePrivateLinkResourceProperties.cs | 3 + ...rivateLinkScopeListResult.Serialization.cs | 65 ++ .../HybridComputePrivateLinkScopePatch.cs | 1 + ...rivateLinkScopeProperties.Serialization.cs | 103 +++ ...HybridComputePrivateLinkScopeProperties.cs | 4 + ...ceConnectionStateProperty.Serialization.cs | 87 ++ ...ivateLinkServiceConnectionStateProperty.cs | 3 + ...bridComputeProductFeature.Serialization.cs | 135 +++ .../Models/HybridComputeProductFeature.cs | 7 + ...dComputeProvisioningIssue.Serialization.cs | 157 ++++ .../Models/HybridComputeProvisioningIssue.cs | 6 + ...omputeResourceAssociation.Serialization.cs | 56 ++ .../HybridComputeResourceAssociation.cs | 2 + .../Models/HybridComputeResourceUpdate.cs | 1 + ...ybridComputeServiceStatus.Serialization.cs | 64 ++ .../Models/HybridComputeServiceStatus.cs | 2 + ...ridComputeServiceStatuses.Serialization.cs | 48 ++ .../Models/HybridComputeServiceStatuses.cs | 2 + .../HybridComputeSubnet.Serialization.cs | 41 + .../Generated/Models/HybridComputeSubnet.cs | 1 + ...teTargetResourceSettings.Serialization.cs} | 145 +++- ...=> HybridComputeTargetResourceSettings.cs} | 14 +- ...mputeWindowsConfiguration.Serialization.cs | 90 +- .../HybridComputeWindowsConfiguration.cs | 14 +- .../Models/HybridComputeWindowsParameters.cs | 5 + ...iesWithoutAssignedLicense.Serialization.cs | 102 +++ ...eArmEsuPropertiesWithoutAssignedLicense.cs | 3 + ...rofileMachineInstanceView.Serialization.cs | 226 +++++ .../LicenseProfileMachineInstanceView.cs | 12 + ...InstanceViewEsuProperties.Serialization.cs | 132 +++ ...ProfileMachineInstanceViewEsuProperties.cs | 2 + ...StorageModelEsuProperties.Serialization.cs | 57 ++ ...LicenseProfileStorageModelEsuProperties.cs | 2 + .../LicensesListResult.Serialization.cs | 65 ++ ...achineAssessPatchesResult.Serialization.cs | 171 ++++ .../Models/MachineAssessPatchesResult.cs | 10 + ...hineExtensionInstanceView.Serialization.cs | 102 +++ .../Models/MachineExtensionInstanceView.cs | 4 + ...tensionInstanceViewStatus.Serialization.cs | 118 +++ .../MachineExtensionInstanceViewStatus.cs | 5 + ...achineExtensionProperties.Serialization.cs | 239 ++++++ .../Models/MachineExtensionProperties.cs | 10 + .../Models/MachineExtensionUpgrade.cs | 1 + ...chineExtensionsListResult.Serialization.cs | 65 ++ .../Models/MachineInstallPatchesContent.cs | 4 + ...chineInstallPatchesResult.Serialization.cs | 254 ++++++ .../Models/MachineInstallPatchesResult.cs | 15 + .../Models/MachineListResult.Serialization.cs | 65 ++ ...ineRunCommandInstanceView.Serialization.cs | 173 ++++ .../Models/MachineRunCommandInstanceView.cs | 8 + ...ineRunCommandScriptSource.Serialization.cs | 94 ++ .../Models/MachineRunCommandScriptSource.cs | 4 + ...hineRunCommandsListResult.Serialization.cs | 65 ++ .../NetworkSecurityPerimeter.Serialization.cs | 79 ++ .../Models/NetworkSecurityPerimeter.cs | 3 + ...erConfigurationListResult.Serialization.cs | 65 ++ ...kSecurityPerimeterProfile.Serialization.cs | 131 +++ .../Models/NetworkSecurityPerimeterProfile.cs | 5 + .../PatchSettingsStatus.Serialization.cs | 141 --- ...dpointConnectionDataModel.Serialization.cs | 86 ++ .../PrivateEndpointConnectionDataModel.cs | 1 + ...inkScopeValidationDetails.Serialization.cs | 72 ++ .../PrivateLinkScopeValidationDetails.cs | 3 + .../RunCommandInputParameter.Serialization.cs | 64 ++ .../Models/RunCommandInputParameter.cs | 2 + ...RunCommandManagedIdentity.Serialization.cs | 48 ++ .../Models/RunCommandManagedIdentity.cs | 2 + .../VolumeLicenseDetails.Serialization.cs | 56 ++ .../Generated/Models/VolumeLicenseDetails.cs | 2 + ...erimeterConfigurationData.Serialization.cs | 166 ++++ ...tworkSecurityPerimeterConfigurationData.cs | 5 + .../RestOperations/GatewaysRestOperations.cs | 40 +- .../RestOperations/SettingsRestOperations.cs | 34 +- .../src/autorest.md | 11 + 163 files changed, 9462 insertions(+), 992 deletions(-) rename sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/{Sample_GatewayCollection.cs => Sample_HybridComputeGatewayCollection.cs} (83%) rename sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/{Sample_GatewayResource.cs => Sample_HybridComputeGatewayResource.cs} (72%) delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/GatewayData.Serialization.cs delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/GatewayResource.Serialization.cs rename sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/{GatewayCollection.cs => HybridComputeGatewayCollection.cs} (65%) create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeGatewayData.Serialization.cs rename sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/{GatewayData.cs => HybridComputeGatewayData.cs} (73%) create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeGatewayResource.Serialization.cs rename sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/{GatewayResource.cs => HybridComputeGatewayResource.cs} (71%) create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Internal/BicepSerializationHelpers.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Internal/WirePathAttribute.cs delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/GatewayOperationSource.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/HybridComputeGatewayOperationSource.cs delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewayType.cs rename sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/{GatewayPatch.Serialization.cs => HybridComputeGatewayPatch.Serialization.cs} (72%) rename sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/{GatewayPatch.cs => HybridComputeGatewayPatch.cs} (60%) create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeGatewayType.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePatchSettingsStatus.Serialization.cs rename sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/{PatchSettingsStatus.cs => HybridComputePatchSettingsStatus.cs} (81%) rename sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/{Settings.Serialization.cs => HybridComputeTargetResourceSettings.Serialization.cs} (54%) rename sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/{Settings.cs => HybridComputeTargetResourceSettings.cs} (76%) delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PatchSettingsStatus.Serialization.cs diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/CHANGELOG.md b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/CHANGELOG.md index 001e17ec5e39e..e3773165cfa93 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/CHANGELOG.md +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/CHANGELOG.md @@ -1,33 +1,29 @@ # Release History -## 1.0.0-beta.10 (Unreleased) +## 1.0.0-beta.10 (2024-07-12) ### Features Added -### Breaking Changes - -### Bugs Fixed - -### Other Changes +- 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 ## 1.0.0-beta.9 (2024-06-07) ### Features Added - Upgraded api-version tag to 'package-preview-2024-03'. Tag detail available at https://github.com/Azure/azure-rest-api-specs/blob/5f0ca7e524c788be5f2b7e7488076dadba7b26ce/specification/hybridcompute/resource-manager/readme.md. - - Add esu license operations for hybrid machine. - - Add network sevurity perimeter operations for hybrid machine. + - Added esu license operations for hybrid machine. + - Added network sevurity perimeter operations for hybrid machine. ## 1.0.0-beta.8 (2024-05-07) ### Features Added -- Enable the new model serialization by using the System.ClientModel, refer this [document](https://aka.ms/azsdk/net/mrw) for more details. -- Add `ArmOperation.Rehydrate` and `ArmOperation.Rehydrate` static methods to rehydrate a long-running operation. +- Enabled the new model serialization by using the System.ClientModel, refer this [document](https://aka.ms/azsdk/net/mrw) for more details. +- Added `ArmOperation.Rehydrate` and `ArmOperation.Rehydrate` static methods to rehydrate a long-running operation. ### Bugs Fixed -- Fix format type of ESU license status +- Fixed format type of ESU license status ## 1.0.0-beta.7 (2024-01-03) @@ -40,7 +36,7 @@ ### Features Added -- Enable mocking for extension methods, refer this [document](https://aka.ms/azsdk/net/mocking) for more details. +- Enabled mocking for extension methods, refer this [document](https://aka.ms/azsdk/net/mocking) for more details. ### Other Changes @@ -57,7 +53,7 @@ ### Features Added -- Enable the model factory feature for model mocking, more information can be found [here](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-mocking-factory-builder). +- Enabled the model factory feature for model mocking, more information can be found [here](https://azure.github.io/azure-sdk/dotnet_introduction.html#dotnet-mocking-factory-builder). ### Other Changes @@ -95,4 +91,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). +> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). \ No newline at end of file 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 e5f1b0a39e788..efe56ef0e09be 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,6 +6,12 @@ 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; } @@ -31,6 +37,8 @@ public static partial class HybridComputeExtensions 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 partial class HybridComputeExtensionValueCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -49,7 +57,7 @@ protected HybridComputeExtensionValueCollection() { } } public partial class HybridComputeExtensionValueData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - internal HybridComputeExtensionValueData() { } + public HybridComputeExtensionValueData() { } public string ExtensionType { get { throw null; } } public string Publisher { get { throw null; } } public string Version { get { throw null; } } @@ -74,6 +82,62 @@ 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; } } + 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() { } @@ -542,6 +606,7 @@ 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; } @@ -554,6 +619,9 @@ protected MockableHybridComputeArmClient() { } 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; } @@ -563,6 +631,8 @@ 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 { @@ -570,6 +640,8 @@ 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; } @@ -667,14 +739,17 @@ public static partial class ArmHybridComputeModelFactory 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; } + 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; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputeNetworkInterface HybridComputeNetworkInterface(System.Collections.Generic.IEnumerable ipAddresses = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputeNetworkProfile HybridComputeNetworkProfile(System.Collections.Generic.IEnumerable networkInterfaces = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputeOSProfile HybridComputeOSProfile(string computerName = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeWindowsConfiguration windowsConfiguration = null, Azure.ResourceManager.HybridCompute.Models.HybridComputeLinuxConfiguration linuxConfiguration = null) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.HybridComputePatchSettingsStatus HybridComputePatchSettingsStatus(Azure.ResourceManager.HybridCompute.Models.HotpatchEnablementStatus? hotpatchEnablementStatus = default(Azure.ResourceManager.HybridCompute.Models.HotpatchEnablementStatus?), Azure.ResponseError error = null) { throw null; } public static Azure.ResourceManager.HybridCompute.HybridComputePrivateEndpointConnectionData HybridComputePrivateEndpointConnectionData(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.HybridComputePrivateEndpointConnectionProperties HybridComputePrivateEndpointConnectionProperties(Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.HybridCompute.Models.HybridComputePrivateLinkServiceConnectionStateProperty connectionState = null, string provisioningState = null, System.Collections.Generic.IEnumerable groupIds = null) { throw null; } public static Azure.ResourceManager.HybridCompute.HybridComputePrivateLinkResourceData HybridComputePrivateLinkResourceData(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.HybridComputePrivateLinkResourceProperties properties = null) { throw null; } @@ -682,11 +757,13 @@ public static partial class ArmHybridComputeModelFactory public static Azure.ResourceManager.HybridCompute.HybridComputePrivateLinkScopeData HybridComputePrivateLinkScopeData(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.HybridComputePrivateLinkScopeProperties properties = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputePrivateLinkScopeProperties HybridComputePrivateLinkScopeProperties(Azure.ResourceManager.HybridCompute.Models.HybridComputePublicNetworkAccessType? publicNetworkAccess = default(Azure.ResourceManager.HybridCompute.Models.HybridComputePublicNetworkAccessType?), string provisioningState = null, string privateLinkScopeId = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.HybridComputePrivateLinkServiceConnectionStateProperty HybridComputePrivateLinkServiceConnectionStateProperty(string status = null, string description = null, string actionsRequired = null) { throw null; } - 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? billingStartOn = default(System.DateTimeOffset?), System.DateTimeOffset? enrollmentOn = default(System.DateTimeOffset?), System.DateTimeOffset? disenrollmentOn = default(System.DateTimeOffset?)) { throw null; } + 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.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? billingStartOn = default(System.DateTimeOffset?), System.DateTimeOffset? enrollmentOn = default(System.DateTimeOffset?), System.DateTimeOffset? disenrollmentOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable productFeatures = null, bool? isSoftwareAssuranceCustomer = 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; } public static Azure.ResourceManager.HybridCompute.Models.MachineAssessPatchesResult MachineAssessPatchesResult(Azure.ResourceManager.HybridCompute.Models.MachineOperationStatus? status = default(Azure.ResourceManager.HybridCompute.Models.MachineOperationStatus?), System.Guid? assessmentActivityId = default(System.Guid?), bool? isRebootPending = default(bool?), Azure.ResourceManager.HybridCompute.Models.AvailablePatchCountByClassification availablePatchCountByClassification = null, 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; } @@ -834,6 +911,27 @@ public ExtensionTargetProperties() { } 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 HotpatchEnablementStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public HotpatchEnablementStatus(string value) { throw null; } + public static Azure.ResourceManager.HybridCompute.Models.HotpatchEnablementStatus ActionRequired { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.HotpatchEnablementStatus Disabled { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.HotpatchEnablementStatus Enabled { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.HotpatchEnablementStatus PendingEvaluation { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.HotpatchEnablementStatus Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.HybridCompute.Models.HotpatchEnablementStatus 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.HotpatchEnablementStatus left, Azure.ResourceManager.HybridCompute.Models.HotpatchEnablementStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.HybridCompute.Models.HotpatchEnablementStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.HybridCompute.Models.HotpatchEnablementStatus left, Azure.ResourceManager.HybridCompute.Models.HotpatchEnablementStatus right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct HybridComputeAccessMode : System.IEquatable { private readonly object _dummy; @@ -930,6 +1028,33 @@ internal HybridComputeConnectionDetail() { } 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; } } + 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() { } @@ -1057,7 +1182,9 @@ public partial class HybridComputeLinuxConfiguration : System.ClientModel.Primit { public HybridComputeLinuxConfiguration() { } public Azure.ResourceManager.HybridCompute.Models.AssessmentModeType? AssessmentMode { get { throw null; } set { } } + public bool? IsHotpatchingEnabled { get { throw null; } set { } } public Azure.ResourceManager.HybridCompute.Models.PatchModeType? PatchMode { get { throw null; } set { } } + public Azure.ResourceManager.HybridCompute.Models.HybridComputePatchSettingsStatus Status { get { throw null; } } Azure.ResourceManager.HybridCompute.Models.HybridComputeLinuxConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.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.HybridComputeLinuxConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1173,6 +1300,17 @@ public HybridComputeOSProfile() { } public static bool operator !=(Azure.ResourceManager.HybridCompute.Models.HybridComputeOSType left, Azure.ResourceManager.HybridCompute.Models.HybridComputeOSType right) { throw null; } public override string ToString() { throw null; } } + public partial class HybridComputePatchSettingsStatus : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HybridComputePatchSettingsStatus() { } + public Azure.ResponseError Error { get { throw null; } } + public Azure.ResourceManager.HybridCompute.Models.HotpatchEnablementStatus? HotpatchEnablementStatus { get { throw null; } } + Azure.ResourceManager.HybridCompute.Models.HybridComputePatchSettingsStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.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.HybridComputePatchSettingsStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class HybridComputePrivateEndpointConnectionProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public HybridComputePrivateEndpointConnectionProperties() { } @@ -1236,9 +1374,11 @@ public HybridComputePrivateLinkServiceConnectionStateProperty(string status, str public partial class HybridComputeProductFeature : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public HybridComputeProductFeature() { } + 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 string Name { get { throw null; } set { } } public Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatus? SubscriptionStatus { get { throw null; } set { } } Azure.ResourceManager.HybridCompute.Models.HybridComputeProductFeature System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1443,11 +1583,24 @@ public HybridComputeServiceStatuses() { } 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; } } + 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() { } public Azure.ResourceManager.HybridCompute.Models.AssessmentModeType? AssessmentMode { get { throw null; } set { } } + public bool? IsHotpatchingEnabled { get { throw null; } set { } } public Azure.ResourceManager.HybridCompute.Models.PatchModeType? PatchMode { get { throw null; } set { } } + public Azure.ResourceManager.HybridCompute.Models.HybridComputePatchSettingsStatus Status { get { throw null; } } Azure.ResourceManager.HybridCompute.Models.HybridComputeWindowsConfiguration System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.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.HybridComputeWindowsConfiguration System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1537,9 +1690,11 @@ public LicenseProfileArmEsuPropertiesWithoutAssignedLicense() { } public partial class LicenseProfileMachineInstanceView : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public LicenseProfileMachineInstanceView() { } + 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.LicenseProfileMachineInstanceViewEsuProperties EsuProfile { get { throw null; } set { } } public bool? IsSoftwareAssuranceCustomer { get { throw null; } set { } } public string LicenseChannel { get { throw null; } } @@ -1600,8 +1755,10 @@ public LicenseProfileStorageModelEsuProperties() { } private readonly int _dummyPrimitive; public LicenseProfileSubscriptionStatus(string value) { throw null; } public static Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatus Disabled { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatus Disabling { get { throw null; } } public static Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatus Enabled { get { throw null; } } public static Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatus Enabling { get { throw null; } } + public static Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatus Failed { get { throw null; } } public static Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatus Unknown { get { throw null; } } public bool Equals(Azure.ResourceManager.HybridCompute.Models.LicenseProfileSubscriptionStatus other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_GatewayCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeGatewayCollection.cs similarity index 83% rename from sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_GatewayCollection.cs rename to sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeGatewayCollection.cs index 99c0a99550eb7..e254f518b504a 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_GatewayCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeGatewayCollection.cs @@ -14,7 +14,7 @@ namespace Azure.ResourceManager.HybridCompute.Samples { - public partial class Sample_GatewayCollection + public partial class Sample_HybridComputeGatewayCollection { // Create or Update a Gateway [NUnit.Framework.Test] @@ -36,25 +36,25 @@ public async Task CreateOrUpdate_CreateOrUpdateAGateway() ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - // get the collection of this GatewayResource - GatewayCollection collection = resourceGroupResource.GetGateways(); + // get the collection of this HybridComputeGatewayResource + HybridComputeGatewayCollection collection = resourceGroupResource.GetHybridComputeGateways(); // invoke the operation string gatewayName = "{gatewayName}"; - GatewayData data = new GatewayData(new AzureLocation("eastus2euap")) + HybridComputeGatewayData data = new HybridComputeGatewayData(new AzureLocation("eastus2euap")) { - GatewayType = GatewayType.Public, + GatewayType = HybridComputeGatewayType.Public, AllowedFeatures = { "*" }, }; - ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, gatewayName, data); - GatewayResource result = lro.Value; + 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 - GatewayData resourceData = result.Data; + HybridComputeGatewayData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -79,16 +79,16 @@ public async Task Get_GetGateway() ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - // get the collection of this GatewayResource - GatewayCollection collection = resourceGroupResource.GetGateways(); + // get the collection of this HybridComputeGatewayResource + HybridComputeGatewayCollection collection = resourceGroupResource.GetHybridComputeGateways(); // invoke the operation string gatewayName = "{gatewayName}"; - GatewayResource result = await collection.GetAsync(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 - GatewayData resourceData = result.Data; + HybridComputeGatewayData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -113,8 +113,8 @@ public async Task Exists_GetGateway() ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - // get the collection of this GatewayResource - GatewayCollection collection = resourceGroupResource.GetGateways(); + // get the collection of this HybridComputeGatewayResource + HybridComputeGatewayCollection collection = resourceGroupResource.GetHybridComputeGateways(); // invoke the operation string gatewayName = "{gatewayName}"; @@ -143,13 +143,13 @@ public async Task GetIfExists_GetGateway() ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - // get the collection of this GatewayResource - GatewayCollection collection = resourceGroupResource.GetGateways(); + // get the collection of this HybridComputeGatewayResource + HybridComputeGatewayCollection collection = resourceGroupResource.GetHybridComputeGateways(); // invoke the operation string gatewayName = "{gatewayName}"; - NullableResponse response = await collection.GetIfExistsAsync(gatewayName); - GatewayResource result = response.HasValue ? response.Value : null; + NullableResponse response = await collection.GetIfExistsAsync(gatewayName); + HybridComputeGatewayResource result = response.HasValue ? response.Value : null; if (result == null) { @@ -159,7 +159,7 @@ public async Task GetIfExists_GetGateway() { // 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 - GatewayData resourceData = result.Data; + HybridComputeGatewayData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -185,15 +185,15 @@ public async Task GetAll_ListGatewaysByResourceGroup() ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); - // get the collection of this GatewayResource - GatewayCollection collection = resourceGroupResource.GetGateways(); + // get the collection of this HybridComputeGatewayResource + HybridComputeGatewayCollection collection = resourceGroupResource.GetHybridComputeGateways(); // invoke the operation and iterate over the result - await foreach (GatewayResource item in collection.GetAllAsync()) + 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 - GatewayData resourceData = item.Data; + HybridComputeGatewayData resourceData = item.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_GatewayResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeGatewayResource.cs similarity index 72% rename from sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_GatewayResource.cs rename to sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeGatewayResource.cs index 2c9d6ab0e8002..ebb10583a0e10 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_GatewayResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeGatewayResource.cs @@ -14,7 +14,7 @@ namespace Azure.ResourceManager.HybridCompute.Samples { - public partial class Sample_GatewayResource + public partial class Sample_HybridComputeGatewayResource { // Update a Gateway [NUnit.Framework.Test] @@ -29,27 +29,27 @@ public async Task Update_UpdateAGateway() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this GatewayResource created on azure - // for more information of creating GatewayResource, please refer to the document of GatewayResource + // 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 gatewayResourceId = GatewayResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, gatewayName); - GatewayResource gateway = client.GetGatewayResource(gatewayResourceId); + ResourceIdentifier hybridComputeGatewayResourceId = HybridComputeGatewayResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, gatewayName); + HybridComputeGatewayResource hybridComputeGateway = client.GetHybridComputeGatewayResource(hybridComputeGatewayResourceId); // invoke the operation - GatewayPatch patch = new GatewayPatch() + HybridComputeGatewayPatch patch = new HybridComputeGatewayPatch() { AllowedFeatures = { "*" }, }; - GatewayResource result = await gateway.UpdateAsync(patch); + 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 - GatewayData resourceData = result.Data; + HybridComputeGatewayData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -67,20 +67,20 @@ public async Task Get_GetGateway() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this GatewayResource created on azure - // for more information of creating GatewayResource, please refer to the document of GatewayResource + // 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 gatewayResourceId = GatewayResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, gatewayName); - GatewayResource gateway = client.GetGatewayResource(gatewayResourceId); + ResourceIdentifier hybridComputeGatewayResourceId = HybridComputeGatewayResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, gatewayName); + HybridComputeGatewayResource hybridComputeGateway = client.GetHybridComputeGatewayResource(hybridComputeGatewayResourceId); // invoke the operation - GatewayResource result = await gateway.GetAsync(); + 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 - GatewayData resourceData = result.Data; + HybridComputeGatewayData resourceData = result.Data; // for demo we just print out the id Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } @@ -98,16 +98,16 @@ public async Task Delete_DeleteAGateway() // authenticate your client ArmClient client = new ArmClient(cred); - // this example assumes you already have this GatewayResource created on azure - // for more information of creating GatewayResource, please refer to the document of GatewayResource + // 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 gatewayResourceId = GatewayResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, gatewayName); - GatewayResource gateway = client.GetGatewayResource(gatewayResourceId); + ResourceIdentifier hybridComputeGatewayResourceId = HybridComputeGatewayResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, gatewayName); + HybridComputeGatewayResource hybridComputeGateway = client.GetHybridComputeGatewayResource(hybridComputeGatewayResourceId); // invoke the operation - await gateway.DeleteAsync(WaitUntil.Completed); + await hybridComputeGateway.DeleteAsync(WaitUntil.Completed); Console.WriteLine($"Succeeded"); } @@ -115,7 +115,7 @@ public async Task Delete_DeleteAGateway() // List Gateways by Subscription [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task GetGateways_ListGatewaysBySubscription() + 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. @@ -132,11 +132,11 @@ public async Task GetGateways_ListGatewaysBySubscription() SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); // invoke the operation and iterate over the result - await foreach (GatewayResource item in subscriptionResource.GetGatewaysAsync()) + 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 - GatewayData resourceData = item.Data; + HybridComputeGatewayData resourceData = item.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_HybridComputeMachineResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_HybridComputeMachineResource.cs index 3771362a9a16a..98371ee0cc594 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 @@ -50,7 +50,7 @@ public async Task Update_UpdateAMachine() { AssessmentMode = AssessmentModeType.ImageDefault, PatchMode = PatchModeType.AutomaticByPlatform, - EnableHotpatching = true, + IsHotpatchingEnabled = true, }, LinuxConfiguration = new HybridComputeLinuxConfiguration() { 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 index 87dc3641ad584..447dfa6793767 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs @@ -19,7 +19,7 @@ public partial class Sample_ResourceGroupResourceExtensions // SettingsUpdate [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task UpdateSetting_SettingsUpdate() + 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. @@ -41,11 +41,11 @@ public async Task UpdateSetting_SettingsUpdate() string baseResourceType = "machines"; string baseResourceName = "testMachine"; string settingsResourceName = "default"; - Settings settings = new Settings() + HybridComputeTargetResourceSettings hybridComputeTargetResourceSettings = new HybridComputeTargetResourceSettings() { GatewayResourceId = new ResourceIdentifier("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/hybridRG/providers/Microsoft.HybridCompute/gateways/newGateway"), }; - Settings result = await resourceGroupResource.UpdateSettingAsync(baseProvider, baseResourceType, baseResourceName, settingsResourceName, settings); + 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 45d590f3f5857..474aa1f9274ba 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArmHybridComputeModelFactory.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/ArmHybridComputeModelFactory.cs @@ -85,32 +85,32 @@ public static HybridComputeOSProfile HybridComputeOSProfile(string computerName /// 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. + /// 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? enableHotpatching = null, PatchSettingsStatus status = null) + public static HybridComputeWindowsConfiguration HybridComputeWindowsConfiguration(AssessmentModeType? assessmentMode = null, PatchModeType? patchMode = null, bool? isHotpatchingEnabled = null, HybridComputePatchSettingsStatus status = null) { - return new HybridComputeWindowsConfiguration(assessmentMode, patchMode, enableHotpatching, status, serializedAdditionalRawData: null); + return new HybridComputeWindowsConfiguration(assessmentMode, patchMode, isHotpatchingEnabled, status, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// 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 PatchSettingsStatus PatchSettingsStatus(HotpatchEnablementStatus? hotpatchEnablementStatus = null, ResponseError error = null) + /// A new instance for mocking. + public static HybridComputePatchSettingsStatus HybridComputePatchSettingsStatus(HotpatchEnablementStatus? hotpatchEnablementStatus = null, ResponseError error = null) { - return new PatchSettingsStatus(hotpatchEnablementStatus, error, serializedAdditionalRawData: 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. + /// 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? enableHotpatching = null, PatchSettingsStatus status = null) + public static HybridComputeLinuxConfiguration HybridComputeLinuxConfiguration(AssessmentModeType? assessmentMode = null, PatchModeType? patchMode = null, bool? isHotpatchingEnabled = null, HybridComputePatchSettingsStatus status = null) { - return new HybridComputeLinuxConfiguration(assessmentMode, patchMode, enableHotpatching, status, serializedAdditionalRawData: null); + return new HybridComputeLinuxConfiguration(assessmentMode, patchMode, isHotpatchingEnabled, status, serializedAdditionalRawData: null); } /// Initializes a new instance of . @@ -692,7 +692,7 @@ public static ExtensionsResourceStatus ExtensionsResourceStatus(string code = nu serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -704,13 +704,13 @@ public static ExtensionsResourceStatus ExtensionsResourceStatus(string code = nu /// 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 GatewayData GatewayData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, HybridComputeProvisioningState? provisioningState = null, string gatewayId = null, GatewayType? gatewayType = null, string gatewayEndpoint = null, IEnumerable allowedFeatures = null) + /// 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 GatewayData( + return new HybridComputeGatewayData( id, name, resourceType, @@ -725,17 +725,17 @@ public static GatewayData GatewayData(ResourceIdentifier id = null, string name serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// 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 Settings Settings(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, Guid? tenantId = null, ResourceIdentifier gatewayResourceId = null) + /// 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 Settings( + return new HybridComputeTargetResourceSettings( 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 fbb24d5d17eab..ee672734bf273 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/HybridComputeExtensions.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/HybridComputeExtensions.cs @@ -129,22 +129,22 @@ public static MachineRunCommandResource GetMachineRunCommandResource(this ArmCli } /// - /// 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 GatewayResource GetGatewayResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static HybridComputeGatewayResource GetHybridComputeGatewayResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableHybridComputeArmClient(client).GetGatewayResource(id); + return GetMockableHybridComputeArmClient(client).GetHybridComputeGatewayResource(id); } /// @@ -412,20 +412,20 @@ public static Response GetHybridComputeMachine(thi } /// - /// Gets a collection of GatewayResources in the ResourceGroupResource. + /// Gets a collection of HybridComputeGatewayResources in the ResourceGroupResource. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// is null. - /// An object representing collection of GatewayResources and their operations over a GatewayResource. - public static GatewayCollection GetGateways(this ResourceGroupResource resourceGroupResource) + /// 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).GetGateways(); + return GetMockableHybridComputeResourceGroupResource(resourceGroupResource).GetHybridComputeGateways(); } /// @@ -445,12 +445,12 @@ public static GatewayCollection GetGateways(this ResourceGroupResource resourceG /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. @@ -459,11 +459,11 @@ public static GatewayCollection GetGateways(this ResourceGroupResource resourceG /// or is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static async Task> GetGatewayAsync(this ResourceGroupResource resourceGroupResource, string gatewayName, CancellationToken cancellationToken = default) + public static async Task> GetHybridComputeGatewayAsync(this ResourceGroupResource resourceGroupResource, string gatewayName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return await GetMockableHybridComputeResourceGroupResource(resourceGroupResource).GetGatewayAsync(gatewayName, cancellationToken).ConfigureAwait(false); + return await GetMockableHybridComputeResourceGroupResource(resourceGroupResource).GetHybridComputeGatewayAsync(gatewayName, cancellationToken).ConfigureAwait(false); } /// @@ -483,12 +483,12 @@ public static async Task> GetGatewayAsync(this Resourc /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. @@ -497,11 +497,11 @@ public static async Task> GetGatewayAsync(this Resourc /// or is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static Response GetGateway(this ResourceGroupResource resourceGroupResource, string gatewayName, CancellationToken cancellationToken = default) + public static Response GetHybridComputeGateway(this ResourceGroupResource resourceGroupResource, string gatewayName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockableHybridComputeResourceGroupResource(resourceGroupResource).GetGateway(gatewayName, cancellationToken); + return GetMockableHybridComputeResourceGroupResource(resourceGroupResource).GetHybridComputeGateway(gatewayName, cancellationToken); } /// @@ -615,7 +615,7 @@ public static Response GetHybridComputePr /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. @@ -623,15 +623,15 @@ public static Response GetHybridComputePr /// The name of the base Resource Type. /// The name of the base resource. /// The name of the settings resource. - /// Settings details. + /// 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> UpdateSettingAsync(this ResourceGroupResource resourceGroupResource, string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, Settings settings, CancellationToken cancellationToken = default) + /// , , , , 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).UpdateSettingAsync(baseProvider, baseResourceType, baseResourceName, settingsResourceName, settings, cancellationToken).ConfigureAwait(false); + return await GetMockableHybridComputeResourceGroupResource(resourceGroupResource).UpdateTargetResourceSettingAsync(baseProvider, baseResourceType, baseResourceName, settingsResourceName, hybridComputeTargetResourceSettings, cancellationToken).ConfigureAwait(false); } /// @@ -652,7 +652,7 @@ public static async Task> UpdateSettingAsync(this ResourceGro /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. @@ -660,15 +660,15 @@ public static async Task> UpdateSettingAsync(this ResourceGro /// The name of the base Resource Type. /// The name of the base resource. /// The name of the settings resource. - /// Settings details. + /// 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 UpdateSetting(this ResourceGroupResource resourceGroupResource, string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, Settings settings, CancellationToken cancellationToken = default) + /// , , , , 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).UpdateSetting(baseProvider, baseResourceType, baseResourceName, settingsResourceName, settings, cancellationToken); + return GetMockableHybridComputeResourceGroupResource(resourceGroupResource).UpdateTargetResourceSetting(baseProvider, baseResourceType, baseResourceName, settingsResourceName, hybridComputeTargetResourceSettings, cancellationToken); } /// @@ -935,23 +935,23 @@ public static Pageable GetHybridComputeMachines(th /// /// /// 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 GetGatewaysAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetHybridComputeGatewaysAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableHybridComputeSubscriptionResource(subscriptionResource).GetGatewaysAsync(cancellationToken); + return GetMockableHybridComputeSubscriptionResource(subscriptionResource).GetHybridComputeGatewaysAsync(cancellationToken); } /// @@ -971,23 +971,23 @@ public static AsyncPageable GetGatewaysAsync(this SubscriptionR /// /// /// 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 GetGateways(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetHybridComputeGateways(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableHybridComputeSubscriptionResource(subscriptionResource).GetGateways(cancellationToken); + return GetMockableHybridComputeSubscriptionResource(subscriptionResource).GetHybridComputeGateways(cancellationToken); } /// 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 5f0ffd9feca0d..9c6cb94a5bdd3 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeArmClient.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeArmClient.cs @@ -95,15 +95,15 @@ public virtual MachineRunCommandResource GetMachineRunCommandResource(ResourceId } /// - /// 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 GatewayResource GetGatewayResource(ResourceIdentifier id) + /// Returns a object. + public virtual HybridComputeGatewayResource GetHybridComputeGatewayResource(ResourceIdentifier id) { - GatewayResource.ValidateResourceId(id); - return new GatewayResource(Client, id); + HybridComputeGatewayResource.ValidateResourceId(id); + return new HybridComputeGatewayResource(Client, id); } /// 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 bf54be14c0e30..187e7f2205d96 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeResourceGroupResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Extensions/MockableHybridComputeResourceGroupResource.cs @@ -181,11 +181,11 @@ public virtual Response GetHybridComputeMachine(st return GetHybridComputeMachines().Get(machineName, expand, cancellationToken); } - /// Gets a collection of GatewayResources in the ResourceGroupResource. - /// An object representing collection of GatewayResources and their operations over a GatewayResource. - public virtual GatewayCollection GetGateways() + /// 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 GatewayCollection(client, Id)); + return GetCachedClient(client => new HybridComputeGatewayCollection(client, Id)); } /// @@ -205,7 +205,7 @@ public virtual GatewayCollection GetGateways() /// /// /// Resource - /// + /// /// /// /// @@ -214,9 +214,9 @@ public virtual GatewayCollection GetGateways() /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetGatewayAsync(string gatewayName, CancellationToken cancellationToken = default) + public virtual async Task> GetHybridComputeGatewayAsync(string gatewayName, CancellationToken cancellationToken = default) { - return await GetGateways().GetAsync(gatewayName, cancellationToken).ConfigureAwait(false); + return await GetHybridComputeGateways().GetAsync(gatewayName, cancellationToken).ConfigureAwait(false); } /// @@ -236,7 +236,7 @@ public virtual async Task> GetGatewayAsync(string gate /// /// /// Resource - /// + /// /// /// /// @@ -245,9 +245,9 @@ public virtual async Task> GetGatewayAsync(string gate /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetGateway(string gatewayName, CancellationToken cancellationToken = default) + public virtual Response GetHybridComputeGateway(string gatewayName, CancellationToken cancellationToken = default) { - return GetGateways().Get(gatewayName, cancellationToken); + return GetHybridComputeGateways().Get(gatewayName, cancellationToken); } /// Gets a collection of HybridComputePrivateLinkScopeResources in the ResourceGroupResource. @@ -340,23 +340,23 @@ public virtual Response GetHybridComputeP /// The name of the base Resource Type. /// The name of the base resource. /// The name of the settings resource. - /// Settings details. + /// 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> UpdateSettingAsync(string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, Settings settings, CancellationToken cancellationToken = default) + /// , , , 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(settings, nameof(settings)); + Argument.AssertNotNull(hybridComputeTargetResourceSettings, nameof(hybridComputeTargetResourceSettings)); - using var scope = SettingsClientDiagnostics.CreateScope("MockableHybridComputeResourceGroupResource.UpdateSetting"); + using var scope = SettingsClientDiagnostics.CreateScope("MockableHybridComputeResourceGroupResource.UpdateTargetResourceSetting"); scope.Start(); try { - var response = await SettingsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, baseProvider, baseResourceType, baseResourceName, settingsResourceName, settings, cancellationToken).ConfigureAwait(false); + var response = await SettingsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, baseProvider, baseResourceType, baseResourceName, settingsResourceName, hybridComputeTargetResourceSettings, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) @@ -387,23 +387,23 @@ public virtual async Task> UpdateSettingAsync(string baseProv /// The name of the base Resource Type. /// The name of the base resource. /// The name of the settings resource. - /// Settings details. + /// 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 UpdateSetting(string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, Settings settings, CancellationToken cancellationToken = default) + /// , , , 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(settings, nameof(settings)); + Argument.AssertNotNull(hybridComputeTargetResourceSettings, nameof(hybridComputeTargetResourceSettings)); - using var scope = SettingsClientDiagnostics.CreateScope("MockableHybridComputeResourceGroupResource.UpdateSetting"); + using var scope = SettingsClientDiagnostics.CreateScope("MockableHybridComputeResourceGroupResource.UpdateTargetResourceSetting"); scope.Start(); try { - var response = SettingsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, baseProvider, baseResourceType, baseResourceName, settingsResourceName, settings, cancellationToken); + var response = SettingsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, baseProvider, baseResourceType, baseResourceName, settingsResourceName, hybridComputeTargetResourceSettings, cancellationToken); return response; } catch (Exception e) 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 69727cdfe8a65..adeda6adbf35e 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,8 @@ public partial class MockableHybridComputeSubscriptionResource : ArmResource private LicensesRestOperations _hybridComputeLicenseLicensesRestClient; private ClientDiagnostics _hybridComputeMachineMachinesClientDiagnostics; private MachinesRestOperations _hybridComputeMachineMachinesRestClient; - private ClientDiagnostics _gatewayClientDiagnostics; - private GatewaysRestOperations _gatewayRestClient; + private ClientDiagnostics _hybridComputeGatewayGatewaysClientDiagnostics; + private GatewaysRestOperations _hybridComputeGatewayGatewaysRestClient; private ClientDiagnostics _hybridComputePrivateLinkScopePrivateLinkScopesClientDiagnostics; private PrivateLinkScopesRestOperations _hybridComputePrivateLinkScopePrivateLinkScopesRestClient; @@ -43,8 +43,8 @@ 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 GatewayClientDiagnostics => _gatewayClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.HybridCompute", GatewayResource.ResourceType.Namespace, Diagnostics); - private GatewaysRestOperations GatewayRestClient => _gatewayRestClient ??= new GatewaysRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(GatewayResource.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)); @@ -271,17 +271,17 @@ public virtual Pageable GetHybridComputeMachines(C /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetGatewaysAsync(CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetHybridComputeGatewaysAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => GatewayRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => GatewayRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new GatewayResource(Client, GatewayData.DeserializeGatewayData(e)), GatewayClientDiagnostics, Pipeline, "MockableHybridComputeSubscriptionResource.GetGateways", "value", "nextLink", cancellationToken); + 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); } /// @@ -301,17 +301,17 @@ public virtual AsyncPageable GetGatewaysAsync(CancellationToken /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetGateways(CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetHybridComputeGateways(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => GatewayRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => GatewayRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new GatewayResource(Client, GatewayData.DeserializeGatewayData(e)), GatewayClientDiagnostics, Pipeline, "MockableHybridComputeSubscriptionResource.GetGateways", "value", "nextLink", cancellationToken); + 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); } /// diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/GatewayData.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/GatewayData.Serialization.cs deleted file mode 100644 index 43f170114d0f9..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/GatewayData.Serialization.cs +++ /dev/null @@ -1,299 +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; -using Azure.ResourceManager.HybridCompute.Models; -using Azure.ResourceManager.Models; - -namespace Azure.ResourceManager.HybridCompute -{ - public partial class GatewayData : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(GatewayData)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - 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(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - GatewayData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(GatewayData)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeGatewayData(document.RootElement, options); - } - - internal static GatewayData DeserializeGatewayData(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; - GatewayType? 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 GatewayType(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 GatewayData( - id, - name, - type, - systemData, - tags ?? new ChangeTrackingDictionary(), - location, - provisioningState, - gatewayId, - gatewayType, - gatewayEndpoint, - allowedFeatures ?? new ChangeTrackingList(), - serializedAdditionalRawData); - } - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - - switch (format) - { - case "J": - return ModelReaderWriter.Write(this, options); - default: - throw new FormatException($"The model {nameof(GatewayData)} does not support writing '{options.Format}' format."); - } - } - - GatewayData 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 DeserializeGatewayData(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(GatewayData)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/GatewayResource.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/GatewayResource.Serialization.cs deleted file mode 100644 index d83a53461866f..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/GatewayResource.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 GatewayResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - GatewayData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - GatewayData 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/HybridComputeExtensionValueData.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeExtensionValueData.Serialization.cs index 7ab655eebbe34..28cb1ed8a5db5 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeExtensionValueData.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeExtensionValueData.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; using Azure.ResourceManager.Models; @@ -182,6 +183,146 @@ internal static HybridComputeExtensionValueData DeserializeHybridComputeExtensio 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(Version), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" version: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Version)) + { + builder.Append(" version: "); + if (Version.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Version}'''"); + } + else + { + builder.AppendLine($"'{Version}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ExtensionType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" extensionType: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ExtensionType)) + { + builder.Append(" extensionType: "); + if (ExtensionType.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ExtensionType}'''"); + } + else + { + builder.AppendLine($"'{ExtensionType}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Publisher), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" publisher: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Publisher)) + { + builder.Append(" publisher: "); + if (Publisher.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Publisher}'''"); + } + else + { + builder.AppendLine($"'{Publisher}'"); + } + } + } + + 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; @@ -190,6 +331,8 @@ BinaryData IPersistableModel.Write(ModelReaderW { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(HybridComputeExtensionValueData)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeExtensionValueData.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeExtensionValueData.cs index 483a2c91bf1f0..5e9928bfe1b59 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeExtensionValueData.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeExtensionValueData.cs @@ -73,10 +73,13 @@ internal HybridComputeExtensionValueData(ResourceIdentifier id, string name, Res } /// The version of the Extension being received. + [WirePath("properties.version")] public string Version { get; } /// The type of the Extension being received. + [WirePath("properties.extensionType")] public string ExtensionType { get; } /// The publisher of the Extension being received. + [WirePath("properties.publisher")] public string Publisher { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/GatewayCollection.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeGatewayCollection.cs similarity index 65% rename from sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/GatewayCollection.cs rename to sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeGatewayCollection.cs index d528b12455fdd..9a0133660896f 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/GatewayCollection.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeGatewayCollection.cs @@ -19,28 +19,28 @@ 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 GetGateways method from an instance of . + /// 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 GatewayCollection : ArmCollection, IEnumerable, IAsyncEnumerable + public partial class HybridComputeGatewayCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _gatewayClientDiagnostics; - private readonly GatewaysRestOperations _gatewayRestClient; + private readonly ClientDiagnostics _hybridComputeGatewayGatewaysClientDiagnostics; + private readonly GatewaysRestOperations _hybridComputeGatewayGatewaysRestClient; - /// Initializes a new instance of the class for mocking. - protected GatewayCollection() + /// Initializes a new instance of the class for mocking. + protected HybridComputeGatewayCollection() { } - /// 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 parent resource that is the target of operations. - internal GatewayCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + internal HybridComputeGatewayCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _gatewayClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridCompute", GatewayResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(GatewayResource.ResourceType, out string gatewayApiVersion); - _gatewayRestClient = new GatewaysRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, gatewayApiVersion); + _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 @@ -69,7 +69,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Resource - /// + /// /// /// /// @@ -79,17 +79,17 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// 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, GatewayData data, CancellationToken cancellationToken = default) + 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 = _gatewayClientDiagnostics.CreateScope("GatewayCollection.CreateOrUpdate"); + using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _gatewayRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, data, cancellationToken).ConfigureAwait(false); - var operation = new HybridComputeArmOperation(new GatewayOperationSource(Client), _gatewayClientDiagnostics, Pipeline, _gatewayRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, data).Request, response, OperationFinalStateVia.Location); + 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; @@ -118,7 +118,7 @@ public virtual async Task> CreateOrUpdateAsync(Wai /// /// /// Resource - /// + /// /// /// /// @@ -128,17 +128,17 @@ public virtual async Task> CreateOrUpdateAsync(Wai /// 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, GatewayData data, CancellationToken cancellationToken = default) + 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 = _gatewayClientDiagnostics.CreateScope("GatewayCollection.CreateOrUpdate"); + using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayCollection.CreateOrUpdate"); scope.Start(); try { - var response = _gatewayRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, data, cancellationToken); - var operation = new HybridComputeArmOperation(new GatewayOperationSource(Client), _gatewayClientDiagnostics, Pipeline, _gatewayRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, data).Request, response, OperationFinalStateVia.Location); + 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; @@ -167,7 +167,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, /// /// /// Resource - /// + /// /// /// /// @@ -175,18 +175,18 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, /// 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) + public virtual async Task> GetAsync(string gatewayName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); - using var scope = _gatewayClientDiagnostics.CreateScope("GatewayCollection.Get"); + using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayCollection.Get"); scope.Start(); try { - var response = await _gatewayRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, cancellationToken).ConfigureAwait(false); + 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 GatewayResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new HybridComputeGatewayResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -212,7 +212,7 @@ public virtual async Task> GetAsync(string gatewayName /// /// /// Resource - /// + /// /// /// /// @@ -220,18 +220,18 @@ public virtual async Task> GetAsync(string gatewayName /// 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) + public virtual Response Get(string gatewayName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); - using var scope = _gatewayClientDiagnostics.CreateScope("GatewayCollection.Get"); + using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayCollection.Get"); scope.Start(); try { - var response = _gatewayRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, cancellationToken); + var response = _hybridComputeGatewayGatewaysRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new GatewayResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new HybridComputeGatewayResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -257,17 +257,17 @@ public virtual Response Get(string gatewayName, CancellationTok /// /// /// 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) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _gatewayRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _gatewayRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new GatewayResource(Client, GatewayData.DeserializeGatewayData(e)), _gatewayClientDiagnostics, Pipeline, "GatewayCollection.GetAll", "value", "nextLink", cancellationToken); + 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); } /// @@ -287,17 +287,17 @@ public virtual AsyncPageable GetAllAsync(CancellationToken canc /// /// /// 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) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _gatewayRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _gatewayRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new GatewayResource(Client, GatewayData.DeserializeGatewayData(e)), _gatewayClientDiagnostics, Pipeline, "GatewayCollection.GetAll", "value", "nextLink", cancellationToken); + 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); } /// @@ -317,7 +317,7 @@ public virtual Pageable GetAll(CancellationToken cancellationTo /// /// /// Resource - /// + /// /// /// /// @@ -329,11 +329,11 @@ public virtual async Task> ExistsAsync(string gatewayName, Cancel { Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); - using var scope = _gatewayClientDiagnostics.CreateScope("GatewayCollection.Exists"); + using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayCollection.Exists"); scope.Start(); try { - var response = await _gatewayRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, cancellationToken: cancellationToken).ConfigureAwait(false); + 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) @@ -360,7 +360,7 @@ public virtual async Task> ExistsAsync(string gatewayName, Cancel /// /// /// Resource - /// + /// /// /// /// @@ -372,11 +372,11 @@ public virtual Response Exists(string gatewayName, CancellationToken cance { Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); - using var scope = _gatewayClientDiagnostics.CreateScope("GatewayCollection.Exists"); + using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayCollection.Exists"); scope.Start(); try { - var response = _gatewayRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, cancellationToken: cancellationToken); + var response = _hybridComputeGatewayGatewaysRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -403,7 +403,7 @@ public virtual Response Exists(string gatewayName, CancellationToken cance /// /// /// Resource - /// + /// /// /// /// @@ -411,18 +411,18 @@ public virtual Response Exists(string gatewayName, CancellationToken cance /// 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) + public virtual async Task> GetIfExistsAsync(string gatewayName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); - using var scope = _gatewayClientDiagnostics.CreateScope("GatewayCollection.GetIfExists"); + using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayCollection.GetIfExists"); scope.Start(); try { - var response = await _gatewayRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, cancellationToken: cancellationToken).ConfigureAwait(false); + 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 GatewayResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new HybridComputeGatewayResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -448,7 +448,7 @@ public virtual async Task> GetIfExistsAsync(st /// /// /// Resource - /// + /// /// /// /// @@ -456,18 +456,18 @@ public virtual async Task> GetIfExistsAsync(st /// 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) + public virtual NullableResponse GetIfExists(string gatewayName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(gatewayName, nameof(gatewayName)); - using var scope = _gatewayClientDiagnostics.CreateScope("GatewayCollection.GetIfExists"); + using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayCollection.GetIfExists"); scope.Start(); try { - var response = _gatewayRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, cancellationToken: cancellationToken); + var response = _hybridComputeGatewayGatewaysRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, gatewayName, cancellationToken: cancellationToken); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new GatewayResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new HybridComputeGatewayResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -476,7 +476,7 @@ public virtual NullableResponse GetIfExists(string gatewayName, } } - IEnumerator IEnumerable.GetEnumerator() + IEnumerator IEnumerable.GetEnumerator() { return GetAll().GetEnumerator(); } @@ -486,7 +486,7 @@ IEnumerator IEnumerable.GetEnumerator() return GetAll().GetEnumerator(); } - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + 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 new file mode 100644 index 0000000000000..3227339456643 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeGatewayData.Serialization.cs @@ -0,0 +1,535 @@ +// 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) + { + 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."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + if (options.Format != "W") + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W") + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W") + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ResourceType); + } + if (options.Format != "W" && Optional.IsDefined(SystemData)) + { + writer.WritePropertyName("systemData"u8); + JsonSerializer.Serialize(writer, SystemData); + } + 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(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + 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/GatewayData.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeGatewayData.cs similarity index 73% rename from sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/GatewayData.cs rename to sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeGatewayData.cs index fbefd7394535c..f4d567d6c7ef3 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/GatewayData.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeGatewayData.cs @@ -14,10 +14,10 @@ namespace Azure.ResourceManager.HybridCompute { /// - /// A class representing the Gateway data model. + /// A class representing the HybridComputeGateway data model. /// Describes an Arc Gateway. /// - public partial class GatewayData : TrackedResourceData + public partial class HybridComputeGatewayData : TrackedResourceData { /// /// Keeps track of any properties unknown to the library. @@ -51,14 +51,14 @@ public partial class GatewayData : TrackedResourceData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . + /// Initializes a new instance of . /// The location. - public GatewayData(AzureLocation location) : base(location) + public HybridComputeGatewayData(AzureLocation location) : base(location) { AllowedFeatures = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -71,7 +71,7 @@ public GatewayData(AzureLocation location) : base(location) /// 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 GatewayData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, HybridComputeProvisioningState? provisioningState, string gatewayId, GatewayType? gatewayType, string gatewayEndpoint, IList allowedFeatures, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + 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; @@ -81,20 +81,25 @@ internal GatewayData(ResourceIdentifier id, string name, ResourceType resourceTy _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Initializes a new instance of for deserialization. - internal GatewayData() + /// 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. - public GatewayType? GatewayType { get; set; } + [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 new file mode 100644 index 0000000000000..449a75c8fb2e6 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeGatewayResource.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 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/GatewayResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeGatewayResource.cs similarity index 71% rename from sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/GatewayResource.cs rename to sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeGatewayResource.cs index f7184b6992d34..341b964fe557b 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/GatewayResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeGatewayResource.cs @@ -18,14 +18,14 @@ namespace Azure.ResourceManager.HybridCompute { /// - /// A Class representing a Gateway 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 GetGatewayResource method. - /// Otherwise you can get one from its parent resource using the GetGateway method. + /// 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 GatewayResource : ArmResource + public partial class HybridComputeGatewayResource : ArmResource { - /// Generate the resource identifier of a instance. + /// Generate the resource identifier of a instance. /// The subscriptionId. /// The resourceGroupName. /// The gatewayName. @@ -35,35 +35,35 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _gatewayClientDiagnostics; - private readonly GatewaysRestOperations _gatewayRestClient; - private readonly GatewayData _data; + 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 GatewayResource() + /// Initializes a new instance of the class for mocking. + protected HybridComputeGatewayResource() { } - /// 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 GatewayResource(ArmClient client, GatewayData data) : this(client, data.Id) + internal HybridComputeGatewayResource(ArmClient client, HybridComputeGatewayData 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 GatewayResource(ArmClient client, ResourceIdentifier id) : base(client, id) + internal HybridComputeGatewayResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _gatewayClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.HybridCompute", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string gatewayApiVersion); - _gatewayRestClient = new GatewaysRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, gatewayApiVersion); + _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 @@ -74,7 +74,7 @@ internal GatewayResource(ArmClient client, ResourceIdentifier id) : base(client, /// Gets the data representing this Feature. /// Throws if there is no data loaded in the current instance. - public virtual GatewayData Data + public virtual HybridComputeGatewayData Data { get { @@ -107,21 +107,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 = _gatewayClientDiagnostics.CreateScope("GatewayResource.Get"); + using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayResource.Get"); scope.Start(); try { - var response = await _gatewayRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + 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 GatewayResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new HybridComputeGatewayResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -147,21 +147,21 @@ public virtual async Task> GetAsync(CancellationToken /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) + public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _gatewayClientDiagnostics.CreateScope("GatewayResource.Get"); + using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayResource.Get"); scope.Start(); try { - var response = _gatewayRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var response = _hybridComputeGatewayGatewaysRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new GatewayResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new HybridComputeGatewayResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -187,7 +187,7 @@ public virtual Response Get(CancellationToken cancellationToken /// /// /// Resource - /// + /// /// /// /// @@ -195,12 +195,12 @@ public virtual Response Get(CancellationToken cancellationToken /// The cancellation token to use. public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _gatewayClientDiagnostics.CreateScope("GatewayResource.Delete"); + using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayResource.Delete"); scope.Start(); try { - var response = await _gatewayRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new HybridComputeArmOperation(_gatewayClientDiagnostics, Pipeline, _gatewayRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + 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; @@ -229,7 +229,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Resource - /// + /// /// /// /// @@ -237,12 +237,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 = _gatewayClientDiagnostics.CreateScope("GatewayResource.Delete"); + using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayResource.Delete"); scope.Start(); try { - var response = _gatewayRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new HybridComputeArmOperation(_gatewayClientDiagnostics, Pipeline, _gatewayRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + 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; @@ -271,23 +271,23 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Resource - /// + /// /// /// /// /// Parameters supplied to the Update gateway operation. /// The cancellation token to use. /// is null. - public virtual async Task> UpdateAsync(GatewayPatch patch, CancellationToken cancellationToken = default) + public virtual async Task> UpdateAsync(HybridComputeGatewayPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(patch, nameof(patch)); - using var scope = _gatewayClientDiagnostics.CreateScope("GatewayResource.Update"); + using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayResource.Update"); scope.Start(); try { - var response = await _gatewayRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new GatewayResource(Client, response.Value), response.GetRawResponse()); + 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) { @@ -313,23 +313,23 @@ public virtual async Task> UpdateAsync(GatewayPatch pa /// /// /// Resource - /// + /// /// /// /// /// Parameters supplied to the Update gateway operation. /// The cancellation token to use. /// is null. - public virtual Response Update(GatewayPatch patch, CancellationToken cancellationToken = default) + public virtual Response Update(HybridComputeGatewayPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(patch, nameof(patch)); - using var scope = _gatewayClientDiagnostics.CreateScope("GatewayResource.Update"); + using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayResource.Update"); scope.Start(); try { - var response = _gatewayRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); - return Response.FromValue(new GatewayResource(Client, response.Value), response.GetRawResponse()); + 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) { @@ -355,7 +355,7 @@ public virtual Response Update(GatewayPatch patch, Cancellation /// /// /// Resource - /// + /// /// /// /// @@ -363,12 +363,12 @@ public virtual Response Update(GatewayPatch patch, Cancellation /// 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 = _gatewayClientDiagnostics.CreateScope("GatewayResource.AddTag"); + using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayResource.AddTag"); scope.Start(); try { @@ -377,13 +377,13 @@ public virtual async Task> AddTagAsync(string key, str 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 _gatewayRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new GatewayResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + 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 GatewayPatch(); + var patch = new HybridComputeGatewayPatch(); foreach (var tag in current.Tags) { patch.Tags.Add(tag); @@ -417,7 +417,7 @@ public virtual async Task> AddTagAsync(string key, str /// /// /// Resource - /// + /// /// /// /// @@ -425,12 +425,12 @@ public virtual async Task> AddTagAsync(string key, str /// 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 = _gatewayClientDiagnostics.CreateScope("GatewayResource.AddTag"); + using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayResource.AddTag"); scope.Start(); try { @@ -439,13 +439,13 @@ public virtual Response AddTag(string key, string value, Cancel var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues[key] = value; GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _gatewayRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new GatewayResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + 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 GatewayPatch(); + var patch = new HybridComputeGatewayPatch(); foreach (var tag in current.Tags) { patch.Tags.Add(tag); @@ -479,18 +479,18 @@ public virtual Response AddTag(string key, string value, Cancel /// /// /// 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 = _gatewayClientDiagnostics.CreateScope("GatewayResource.SetTags"); + using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayResource.SetTags"); scope.Start(); try { @@ -500,13 +500,13 @@ public virtual async Task> SetTagsAsync(IDictionary> SetTagsAsync(IDictionary /// /// 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 = _gatewayClientDiagnostics.CreateScope("GatewayResource.SetTags"); + using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayResource.SetTags"); scope.Start(); try { @@ -557,13 +557,13 @@ public virtual Response SetTags(IDictionary tag var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.ReplaceWith(tags); GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _gatewayRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new GatewayResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + 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 GatewayPatch(); + var patch = new HybridComputeGatewayPatch(); patch.Tags.ReplaceWith(tags); var result = Update(patch, cancellationToken: cancellationToken); return result; @@ -593,18 +593,18 @@ public virtual Response SetTags(IDictionary tag /// /// /// 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 = _gatewayClientDiagnostics.CreateScope("GatewayResource.RemoveTag"); + using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayResource.RemoveTag"); scope.Start(); try { @@ -613,13 +613,13 @@ public virtual async Task> RemoveTagAsync(string key, 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 _gatewayRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - return Response.FromValue(new GatewayResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + 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 GatewayPatch(); + var patch = new HybridComputeGatewayPatch(); foreach (var tag in current.Tags) { patch.Tags.Add(tag); @@ -653,18 +653,18 @@ public virtual async Task> RemoveTagAsync(string key, /// /// /// 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 = _gatewayClientDiagnostics.CreateScope("GatewayResource.RemoveTag"); + using var scope = _hybridComputeGatewayGatewaysClientDiagnostics.CreateScope("HybridComputeGatewayResource.RemoveTag"); scope.Start(); try { @@ -673,13 +673,13 @@ public virtual Response RemoveTag(string key, CancellationToken var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.Remove(key); GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _gatewayRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - return Response.FromValue(new GatewayResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + 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 GatewayPatch(); + var patch = new HybridComputeGatewayPatch(); foreach (var tag in current.Tags) { patch.Tags.Add(tag); diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseData.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseData.Serialization.cs index cdad4590c0fff..da1844d0d2cef 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseData.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseData.Serialization.cs @@ -8,6 +8,8 @@ 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; @@ -247,6 +249,186 @@ internal static HybridComputeLicenseData DeserializeHybridComputeLicenseData(Jso 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(TenantId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" tenantId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TenantId)) + { + builder.Append(" tenantId: "); + builder.AppendLine($"'{TenantId.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LicenseType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" licenseType: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LicenseType)) + { + builder.Append(" licenseType: "); + builder.AppendLine($"'{LicenseType.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LicenseDetails), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" licenseDetails: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LicenseDetails)) + { + builder.Append(" licenseDetails: "); + BicepSerializationHelpers.AppendChildObject(builder, LicenseDetails, options, 4, false, " licenseDetails: "); + } + } + + 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; @@ -255,6 +437,8 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOp { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(HybridComputeLicenseData)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseData.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseData.cs index 5a78ef315d790..0b10863c9a7a3 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseData.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseData.cs @@ -84,12 +84,16 @@ internal HybridComputeLicenseData() } /// The provisioning state, which only appears in the response. + [WirePath("properties.provisioningState")] public HybridComputeProvisioningState? ProvisioningState { get; } /// Describes the tenant id. + [WirePath("properties.tenantId")] public Guid? TenantId { get; set; } /// The type of the license resource. + [WirePath("properties.licenseType")] public HybridComputeLicenseType? LicenseType { get; set; } /// Describes the properties of a License. + [WirePath("properties.licenseDetails")] public HybridComputeLicenseDetails LicenseDetails { get; set; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineData.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineData.Serialization.cs index 61eb31e99a590..1029e43842ee1 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineData.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineData.Serialization.cs @@ -8,6 +8,8 @@ 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; @@ -712,6 +714,805 @@ internal static HybridComputeMachineData DeserializeHybridComputeMachineData(Jso 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(Resources), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" resources: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Resources)) + { + if (Resources.Any()) + { + builder.Append(" resources: "); + builder.AppendLine("["); + foreach (var item in Resources) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " resources: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Identity), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" identity: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Identity)) + { + builder.Append(" identity: "); + BicepSerializationHelpers.AppendChildObject(builder, Identity, options, 2, false, " identity: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Kind), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" kind: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Kind)) + { + builder.Append(" kind: "); + builder.AppendLine($"'{Kind.Value.ToString()}'"); + } + } + + 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(LocationData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" locationData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LocationData)) + { + builder.Append(" locationData: "); + BicepSerializationHelpers.AppendChildObject(builder, LocationData, options, 4, false, " locationData: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AgentConfiguration), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" agentConfiguration: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AgentConfiguration)) + { + builder.Append(" agentConfiguration: "); + BicepSerializationHelpers.AppendChildObject(builder, AgentConfiguration, options, 4, false, " agentConfiguration: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ServiceStatuses), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" serviceStatuses: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ServiceStatuses)) + { + builder.Append(" serviceStatuses: "); + BicepSerializationHelpers.AppendChildObject(builder, ServiceStatuses, options, 4, false, " serviceStatuses: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("CloudMetadataProvider", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" cloudMetadata: "); + builder.AppendLine("{"); + builder.AppendLine(" cloudMetadata: {"); + builder.Append(" provider: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(CloudMetadata)) + { + builder.Append(" cloudMetadata: "); + BicepSerializationHelpers.AppendChildObject(builder, CloudMetadata, options, 4, false, " cloudMetadata: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AgentUpgrade), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" agentUpgrade: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AgentUpgrade)) + { + builder.Append(" agentUpgrade: "); + BicepSerializationHelpers.AppendChildObject(builder, AgentUpgrade, options, 4, false, " agentUpgrade: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OSProfile), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" osProfile: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(OSProfile)) + { + builder.Append(" osProfile: "); + BicepSerializationHelpers.AppendChildObject(builder, OSProfile, options, 4, false, " osProfile: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LicenseProfile), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" licenseProfile: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LicenseProfile)) + { + builder.Append(" licenseProfile: "); + BicepSerializationHelpers.AppendChildObject(builder, LicenseProfile, options, 4, false, " licenseProfile: "); + } + } + + 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(Status), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" status: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Status)) + { + builder.Append(" status: "); + builder.AppendLine($"'{Status.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LastStatusChange), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" lastStatusChange: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LastStatusChange)) + { + builder.Append(" lastStatusChange: "); + var formattedDateTimeString = TypeFormatters.ToString(LastStatusChange.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ErrorDetails), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" errorDetails: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(ErrorDetails)) + { + if (ErrorDetails.Any()) + { + builder.Append(" errorDetails: "); + builder.AppendLine("["); + foreach (var item in ErrorDetails) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 6, true, " errorDetails: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AgentVersion), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" agentVersion: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AgentVersion)) + { + builder.Append(" agentVersion: "); + if (AgentVersion.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{AgentVersion}'''"); + } + else + { + builder.AppendLine($"'{AgentVersion}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(VmId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" vmId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(VmId)) + { + builder.Append(" vmId: "); + builder.AppendLine($"'{VmId.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DisplayName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" displayName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DisplayName)) + { + builder.Append(" displayName: "); + if (DisplayName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{DisplayName}'''"); + } + else + { + builder.AppendLine($"'{DisplayName}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MachineFqdn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" machineFqdn: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MachineFqdn)) + { + builder.Append(" machineFqdn: "); + if (MachineFqdn.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{MachineFqdn}'''"); + } + else + { + builder.AppendLine($"'{MachineFqdn}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ClientPublicKey), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" clientPublicKey: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ClientPublicKey)) + { + builder.Append(" clientPublicKey: "); + if (ClientPublicKey.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ClientPublicKey}'''"); + } + else + { + builder.AppendLine($"'{ClientPublicKey}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OSName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" osName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(OSName)) + { + builder.Append(" osName: "); + if (OSName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{OSName}'''"); + } + else + { + builder.AppendLine($"'{OSName}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OSVersion), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" osVersion: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(OSVersion)) + { + builder.Append(" osVersion: "); + if (OSVersion.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{OSVersion}'''"); + } + else + { + builder.AppendLine($"'{OSVersion}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OSType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" osType: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(OSType)) + { + builder.Append(" osType: "); + if (OSType.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{OSType}'''"); + } + else + { + builder.AppendLine($"'{OSType}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(VmUuid), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" vmUuid: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(VmUuid)) + { + builder.Append(" vmUuid: "); + builder.AppendLine($"'{VmUuid.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Extensions), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" extensions: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Extensions)) + { + if (Extensions.Any()) + { + builder.Append(" extensions: "); + builder.AppendLine("["); + foreach (var item in Extensions) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 6, true, " extensions: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OSSku), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" osSku: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(OSSku)) + { + builder.Append(" osSku: "); + if (OSSku.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{OSSku}'''"); + } + else + { + builder.AppendLine($"'{OSSku}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OSEdition), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" osEdition: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(OSEdition)) + { + builder.Append(" osEdition: "); + if (OSEdition.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{OSEdition}'''"); + } + else + { + builder.AppendLine($"'{OSEdition}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DomainName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" domainName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DomainName)) + { + builder.Append(" domainName: "); + if (DomainName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{DomainName}'''"); + } + else + { + builder.AppendLine($"'{DomainName}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ADFqdn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" adFqdn: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ADFqdn)) + { + builder.Append(" adFqdn: "); + if (ADFqdn.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ADFqdn}'''"); + } + else + { + builder.AppendLine($"'{ADFqdn}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DnsFqdn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" dnsFqdn: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DnsFqdn)) + { + builder.Append(" dnsFqdn: "); + if (DnsFqdn.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{DnsFqdn}'''"); + } + else + { + builder.AppendLine($"'{DnsFqdn}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PrivateLinkScopeResourceId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" privateLinkScopeResourceId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PrivateLinkScopeResourceId)) + { + builder.Append(" privateLinkScopeResourceId: "); + builder.AppendLine($"'{PrivateLinkScopeResourceId.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ParentClusterResourceId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" parentClusterResourceId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ParentClusterResourceId)) + { + builder.Append(" parentClusterResourceId: "); + builder.AppendLine($"'{ParentClusterResourceId.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MSSqlDiscovered), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" mssqlDiscovered: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MSSqlDiscovered)) + { + builder.Append(" mssqlDiscovered: "); + if (MSSqlDiscovered.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{MSSqlDiscovered}'''"); + } + else + { + builder.AppendLine($"'{MSSqlDiscovered}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DetectedProperties), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" detectedProperties: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(DetectedProperties)) + { + if (DetectedProperties.Any()) + { + builder.Append(" detectedProperties: "); + builder.AppendLine("{"); + foreach (var item in DetectedProperties) + { + 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("NetworkInterfaces", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" networkProfile: "); + builder.AppendLine("{"); + builder.AppendLine(" networkProfile: {"); + builder.Append(" networkInterfaces: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(NetworkProfile)) + { + builder.Append(" networkProfile: "); + BicepSerializationHelpers.AppendChildObject(builder, NetworkProfile, options, 4, false, " networkProfile: "); + } + } + + 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; @@ -720,6 +1521,8 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOp { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(HybridComputeMachineData)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineData.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineData.cs index f110fbdfcce7f..2763ddd3a213f 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineData.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineData.cs @@ -148,80 +148,114 @@ internal HybridComputeMachineData() } /// The list of extensions affiliated to the machine. + [WirePath("resources")] public IReadOnlyList Resources { get; } /// Identity for the resource. Current supported identity types: SystemAssigned. + [WirePath("identity")] public ManagedServiceIdentity Identity { get; set; } /// Indicates which kind of Arc machine placement on-premises, such as HCI, SCVMM or VMware etc. + [WirePath("kind")] public ArcKindEnum? Kind { get; set; } /// Metadata pertaining to the geographic location of the resource. + [WirePath("properties.locationData")] public HybridComputeLocation LocationData { get; set; } /// Configurable properties that the user can set locally via the azcmagent config command, or remotely via ARM. + [WirePath("properties.agentConfiguration")] public AgentConfiguration AgentConfiguration { get; } /// Statuses of dependent services that are reported back to ARM. + [WirePath("properties.serviceStatuses")] public HybridComputeServiceStatuses ServiceStatuses { get; set; } /// The metadata of the cloud environment (Azure/GCP/AWS/OCI...). internal HybridComputeCloudMetadata CloudMetadata { get; set; } /// Specifies the cloud provider (Azure/AWS/GCP...). + [WirePath("properties.cloudMetadata.provider")] public string CloudMetadataProvider { get => CloudMetadata is null ? default : CloudMetadata.Provider; } /// The info of the machine w.r.t Agent Upgrade. + [WirePath("properties.agentUpgrade")] public AgentUpgrade AgentUpgrade { get; set; } /// Specifies the operating system settings for the hybrid machine. + [WirePath("properties.osProfile")] public HybridComputeOSProfile OSProfile { get; set; } /// Specifies the License related properties for a machine. + [WirePath("properties.licenseProfile")] public LicenseProfileMachineInstanceView LicenseProfile { get; set; } /// The provisioning state, which only appears in the response. + [WirePath("properties.provisioningState")] public string ProvisioningState { get; } /// The status of the hybrid machine agent. + [WirePath("properties.status")] public HybridComputeStatusType? Status { get; } /// The time of the last status change. + [WirePath("properties.lastStatusChange")] public DateTimeOffset? LastStatusChange { get; } /// Details about the error state. + [WirePath("properties.errorDetails")] public IReadOnlyList ErrorDetails { get; } /// The hybrid machine agent full version. + [WirePath("properties.agentVersion")] public string AgentVersion { get; } /// Specifies the hybrid machine unique ID. + [WirePath("properties.vmId")] public Guid? VmId { get; set; } /// Specifies the hybrid machine display name. + [WirePath("properties.displayName")] public string DisplayName { get; } /// Specifies the hybrid machine FQDN. + [WirePath("properties.machineFqdn")] public string MachineFqdn { get; } /// Public Key that the client provides to be used during initial resource onboarding. + [WirePath("properties.clientPublicKey")] public string ClientPublicKey { get; set; } /// The Operating System running on the hybrid machine. + [WirePath("properties.osName")] public string OSName { get; } /// The version of Operating System running on the hybrid machine. + [WirePath("properties.osVersion")] public string OSVersion { get; } /// The type of Operating System (windows/linux). + [WirePath("properties.osType")] public string OSType { get; set; } /// Specifies the Arc Machine's unique SMBIOS ID. + [WirePath("properties.vmUuid")] public Guid? VmUuid { get; } /// Machine Extensions information (deprecated field). + [WirePath("properties.extensions")] public IList Extensions { get; } /// Specifies the Operating System product SKU. + [WirePath("properties.osSku")] public string OSSku { get; } /// The edition of the Operating System. + [WirePath("properties.osEdition")] public string OSEdition { get; } /// Specifies the Windows domain name. + [WirePath("properties.domainName")] public string DomainName { get; } /// Specifies the AD fully qualified display name. + [WirePath("properties.adFqdn")] public string ADFqdn { get; } /// Specifies the DNS fully qualified display name. + [WirePath("properties.dnsFqdn")] public string DnsFqdn { get; } /// The resource id of the private link scope this machine is assigned to, if any. + [WirePath("properties.privateLinkScopeResourceId")] public ResourceIdentifier PrivateLinkScopeResourceId { get; set; } /// The resource id of the parent cluster (Azure HCI) this machine is assigned to, if any. + [WirePath("properties.parentClusterResourceId")] public ResourceIdentifier ParentClusterResourceId { get; set; } /// Specifies whether any MS SQL instance is discovered on the machine. + [WirePath("properties.mssqlDiscovered")] public string MSSqlDiscovered { get; set; } /// Detected properties from the machine. + [WirePath("properties.detectedProperties")] public IReadOnlyDictionary DetectedProperties { get; } /// Information about the network the machine is on. internal HybridComputeNetworkProfile NetworkProfile { get; } /// The list of network interfaces. + [WirePath("properties.networkProfile.networkInterfaces")] public IReadOnlyList NetworkInterfaces { get => NetworkProfile?.NetworkInterfaces; diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineExtensionData.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineExtensionData.Serialization.cs index 3e0974b31ff9b..925727dd71558 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineExtensionData.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineExtensionData.Serialization.cs @@ -8,6 +8,8 @@ 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; @@ -184,6 +186,138 @@ internal static HybridComputeMachineExtensionData DeserializeHybridComputeMachin 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(Properties), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" properties: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Properties)) + { + builder.Append(" properties: "); + BicepSerializationHelpers.AppendChildObject(builder, Properties, options, 2, false, " properties: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -192,6 +326,8 @@ BinaryData IPersistableModel.Write(ModelReade { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(HybridComputeMachineExtensionData)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineExtensionData.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineExtensionData.cs index c35c149d6b080..ac4de90f1cbc4 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineExtensionData.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeMachineExtensionData.cs @@ -78,6 +78,7 @@ internal HybridComputeMachineExtensionData() } /// Describes Machine Extension Properties. + [WirePath("properties")] public MachineExtensionProperties Properties { get; set; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateEndpointConnectionData.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateEndpointConnectionData.Serialization.cs index b0df828d1337f..a879df1bb4815 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateEndpointConnectionData.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateEndpointConnectionData.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; using Azure.ResourceManager.HybridCompute.Models; @@ -148,6 +149,89 @@ internal static HybridComputePrivateEndpointConnectionData DeserializeHybridComp 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(Properties), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" properties: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Properties)) + { + builder.Append(" properties: "); + BicepSerializationHelpers.AppendChildObject(builder, Properties, options, 2, false, " properties: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -156,6 +240,8 @@ BinaryData IPersistableModel.Write(M { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(HybridComputePrivateEndpointConnectionData)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateEndpointConnectionData.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateEndpointConnectionData.cs index 7f6259f94a819..ab95f3cb83905 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateEndpointConnectionData.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateEndpointConnectionData.cs @@ -70,6 +70,7 @@ internal HybridComputePrivateEndpointConnectionData(ResourceIdentifier id, strin } /// Resource properties. + [WirePath("properties")] public HybridComputePrivateEndpointConnectionProperties Properties { get; set; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkResourceData.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkResourceData.Serialization.cs index f5a853ee45ca0..9b94597099cdd 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkResourceData.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkResourceData.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; using Azure.ResourceManager.HybridCompute.Models; @@ -148,6 +149,89 @@ internal static HybridComputePrivateLinkResourceData DeserializeHybridComputePri 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(Properties), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" properties: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Properties)) + { + builder.Append(" properties: "); + BicepSerializationHelpers.AppendChildObject(builder, Properties, options, 2, false, " properties: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -156,6 +240,8 @@ BinaryData IPersistableModel.Write(ModelRe { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(HybridComputePrivateLinkResourceData)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkResourceData.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkResourceData.cs index 7b406a0f422a0..f27536b4c1f15 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkResourceData.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkResourceData.cs @@ -70,6 +70,7 @@ internal HybridComputePrivateLinkResourceData(ResourceIdentifier id, string name } /// Resource properties. + [WirePath("properties")] public HybridComputePrivateLinkResourceProperties Properties { get; set; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkScopeData.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkScopeData.Serialization.cs index b04c76e8c0d31..aa81bafadc6b8 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkScopeData.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkScopeData.Serialization.cs @@ -8,6 +8,8 @@ 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; @@ -184,6 +186,138 @@ internal static HybridComputePrivateLinkScopeData DeserializeHybridComputePrivat 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(Properties), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" properties: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Properties)) + { + builder.Append(" properties: "); + BicepSerializationHelpers.AppendChildObject(builder, Properties, options, 2, false, " properties: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -192,6 +326,8 @@ BinaryData IPersistableModel.Write(ModelReade { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(HybridComputePrivateLinkScopeData)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkScopeData.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkScopeData.cs index b34be76d188ea..5730027e2bb39 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkScopeData.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputePrivateLinkScopeData.cs @@ -78,6 +78,7 @@ internal HybridComputePrivateLinkScopeData() } /// Properties that define a Azure Arc PrivateLinkScope resource. + [WirePath("properties")] public HybridComputePrivateLinkScopeProperties Properties { get; set; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Internal/BicepSerializationHelpers.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Internal/BicepSerializationHelpers.cs new file mode 100644 index 0000000000000..324d14e378cb2 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Internal/BicepSerializationHelpers.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text; + +namespace Azure.ResourceManager.HybridCompute +{ + internal static class BicepSerializationHelpers + { + public static void AppendChildObject(StringBuilder stringBuilder, object childObject, ModelReaderWriterOptions options, int spaces, bool indentFirstLine, string formattedPropertyName) + { + string indent = new string(' ', spaces); + int emptyObjectLength = 2 + spaces + Environment.NewLine.Length + Environment.NewLine.Length; + int length = stringBuilder.Length; + bool inMultilineString = false; + + BinaryData data = ModelReaderWriter.Write(childObject, options); + string[] lines = data.ToString().Split(Environment.NewLine.ToCharArray(), StringSplitOptions.RemoveEmptyEntries); + for (int i = 0; i < lines.Length; i++) + { + string line = lines[i]; + if (inMultilineString) + { + if (line.Contains("'''")) + { + inMultilineString = false; + } + stringBuilder.AppendLine(line); + continue; + } + if (line.Contains("'''")) + { + inMultilineString = true; + stringBuilder.AppendLine($"{indent}{line}"); + continue; + } + if (i == 0 && !indentFirstLine) + { + stringBuilder.AppendLine($"{line}"); + } + else + { + stringBuilder.AppendLine($"{indent}{line}"); + } + } + if (stringBuilder.Length == length + emptyObjectLength) + { + stringBuilder.Length = stringBuilder.Length - emptyObjectLength - formattedPropertyName.Length; + } + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Internal/WirePathAttribute.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Internal/WirePathAttribute.cs new file mode 100644 index 0000000000000..43099a0742f39 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Internal/WirePathAttribute.cs @@ -0,0 +1,27 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.HybridCompute +{ + [AttributeUsage(AttributeTargets.Property)] + internal class WirePathAttribute : Attribute + { + private string _wirePath; + + public WirePathAttribute(string wirePath) + { + _wirePath = wirePath; + } + + public override string ToString() + { + return _wirePath; + } + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/GatewayOperationSource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/GatewayOperationSource.cs deleted file mode 100644 index 4d392372766bf..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/GatewayOperationSource.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 GatewayOperationSource : IOperationSource - { - private readonly ArmClient _client; - - internal GatewayOperationSource(ArmClient client) - { - _client = client; - } - - GatewayResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) - { - using var document = JsonDocument.Parse(response.ContentStream); - var data = GatewayData.DeserializeGatewayData(document.RootElement); - return new GatewayResource(_client, data); - } - - async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) - { - using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); - var data = GatewayData.DeserializeGatewayData(document.RootElement); - return new GatewayResource(_client, data); - } - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/HybridComputeGatewayOperationSource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/HybridComputeGatewayOperationSource.cs new file mode 100644 index 0000000000000..a8caa3bd0e2c9 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/LongRunningOperation/HybridComputeGatewayOperationSource.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 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/MachineRunCommandData.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandData.Serialization.cs index 743cdc8b11285..acf7e1b52ea7a 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandData.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandData.Serialization.cs @@ -8,6 +8,8 @@ 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; @@ -399,6 +401,362 @@ internal static MachineRunCommandData DeserializeMachineRunCommandData(JsonEleme 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; @@ -407,6 +765,8 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptio { 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."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandData.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandData.cs index fbc755f1f40f3..d6369c6d0fae5 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandData.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/MachineRunCommandData.cs @@ -104,30 +104,43 @@ 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/Models/AgentConfiguration.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/AgentConfiguration.Serialization.cs index 68835ee985299..d0e96f335aacf 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/AgentConfiguration.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/AgentConfiguration.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; @@ -238,6 +240,215 @@ internal static AgentConfiguration DeserializeAgentConfiguration(JsonElement ele 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(ProxyUri), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" proxyUrl: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProxyUri)) + { + builder.Append(" proxyUrl: "); + builder.AppendLine($"'{ProxyUri.AbsoluteUri}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IncomingConnectionsPorts), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" incomingConnectionsPorts: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(IncomingConnectionsPorts)) + { + if (IncomingConnectionsPorts.Any()) + { + builder.Append(" incomingConnectionsPorts: "); + builder.AppendLine("["); + foreach (var item in IncomingConnectionsPorts) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ExtensionsAllowList), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" extensionsAllowList: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(ExtensionsAllowList)) + { + if (ExtensionsAllowList.Any()) + { + builder.Append(" extensionsAllowList: "); + builder.AppendLine("["); + foreach (var item in ExtensionsAllowList) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " extensionsAllowList: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ExtensionsBlockList), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" extensionsBlockList: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(ExtensionsBlockList)) + { + if (ExtensionsBlockList.Any()) + { + builder.Append(" extensionsBlockList: "); + builder.AppendLine("["); + foreach (var item in ExtensionsBlockList) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " extensionsBlockList: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProxyBypass), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" proxyBypass: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(ProxyBypass)) + { + if (ProxyBypass.Any()) + { + builder.Append(" proxyBypass: "); + builder.AppendLine("["); + foreach (var item in ProxyBypass) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ExtensionsEnabled), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" extensionsEnabled: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ExtensionsEnabled)) + { + builder.Append(" extensionsEnabled: "); + if (ExtensionsEnabled.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ExtensionsEnabled}'''"); + } + else + { + builder.AppendLine($"'{ExtensionsEnabled}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(GuestConfigurationEnabled), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" guestConfigurationEnabled: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(GuestConfigurationEnabled)) + { + builder.Append(" guestConfigurationEnabled: "); + if (GuestConfigurationEnabled.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{GuestConfigurationEnabled}'''"); + } + else + { + builder.AppendLine($"'{GuestConfigurationEnabled}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ConfigMode), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" configMode: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ConfigMode)) + { + builder.Append(" configMode: "); + builder.AppendLine($"'{ConfigMode.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -246,6 +457,8 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(AgentConfiguration)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/AgentConfiguration.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/AgentConfiguration.cs index 34498ca03eae9..fd68e12ab5ce1 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/AgentConfiguration.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/AgentConfiguration.cs @@ -78,20 +78,28 @@ internal AgentConfiguration(Uri proxyUri, IReadOnlyList incomingConnecti } /// Specifies the URL of the proxy to be used. + [WirePath("proxyUrl")] public Uri ProxyUri { get; } /// Specifies the list of ports that the agent will be able to listen on. + [WirePath("incomingConnectionsPorts")] public IReadOnlyList IncomingConnectionsPorts { get; } /// Array of extensions that are allowed to be installed or updated. + [WirePath("extensionsAllowList")] public IReadOnlyList ExtensionsAllowList { get; } /// Array of extensions that are blocked (cannot be installed or updated). + [WirePath("extensionsBlockList")] public IReadOnlyList ExtensionsBlockList { get; } /// List of service names which should not use the specified proxy server. + [WirePath("proxyBypass")] public IReadOnlyList ProxyBypass { get; } /// Specifies whether the extension service is enabled or disabled. + [WirePath("extensionsEnabled")] public string ExtensionsEnabled { get; } /// Specified whether the guest configuration service is enabled or disabled. + [WirePath("guestConfigurationEnabled")] public string GuestConfigurationEnabled { get; } /// Name of configuration mode to use. Modes are pre-defined configurations of security controls, extension allowlists and guest configuration, maintained by Microsoft. + [WirePath("configMode")] public AgentConfigurationMode? ConfigMode { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/AgentUpgrade.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/AgentUpgrade.Serialization.cs index 27519752306fd..92e41dad408a0 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/AgentUpgrade.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/AgentUpgrade.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -178,6 +179,152 @@ internal static AgentUpgrade DeserializeAgentUpgrade(JsonElement element, ModelR 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(DesiredVersion), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" desiredVersion: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DesiredVersion)) + { + builder.Append(" desiredVersion: "); + if (DesiredVersion.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{DesiredVersion}'''"); + } + else + { + builder.AppendLine($"'{DesiredVersion}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CorrelationId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" correlationId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CorrelationId)) + { + builder.Append(" correlationId: "); + builder.AppendLine($"'{CorrelationId.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsAutomaticUpgradeEnabled), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" enableAutomaticUpgrade: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IsAutomaticUpgradeEnabled)) + { + builder.Append(" enableAutomaticUpgrade: "); + var boolValue = IsAutomaticUpgradeEnabled.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LastAttemptDesiredVersion), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" lastAttemptDesiredVersion: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LastAttemptDesiredVersion)) + { + builder.Append(" lastAttemptDesiredVersion: "); + if (LastAttemptDesiredVersion.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{LastAttemptDesiredVersion}'''"); + } + else + { + builder.AppendLine($"'{LastAttemptDesiredVersion}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LastAttemptedOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" lastAttemptTimestamp: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LastAttemptedOn)) + { + builder.Append(" lastAttemptTimestamp: "); + var formattedDateTimeString = TypeFormatters.ToString(LastAttemptedOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LastAttemptStatus), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" lastAttemptStatus: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LastAttemptStatus)) + { + builder.Append(" lastAttemptStatus: "); + builder.AppendLine($"'{LastAttemptStatus.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LastAttemptMessage), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" lastAttemptMessage: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LastAttemptMessage)) + { + builder.Append(" lastAttemptMessage: "); + if (LastAttemptMessage.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{LastAttemptMessage}'''"); + } + else + { + builder.AppendLine($"'{LastAttemptMessage}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -186,6 +333,8 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions option { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(AgentUpgrade)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/AgentUpgrade.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/AgentUpgrade.cs index 93753b045d5d0..385ee381cf9ac 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/AgentUpgrade.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/AgentUpgrade.cs @@ -72,18 +72,25 @@ internal AgentUpgrade(string desiredVersion, Guid? correlationId, bool? isAutoma } /// Specifies the version info w.r.t AgentUpgrade for the machine. + [WirePath("desiredVersion")] public string DesiredVersion { get; set; } /// The correlation ID passed in from RSM per upgrade. + [WirePath("correlationId")] public Guid? CorrelationId { get; set; } /// Specifies if RSM should try to upgrade this machine. + [WirePath("enableAutomaticUpgrade")] public bool? IsAutomaticUpgradeEnabled { get; set; } /// Specifies the version of the last attempt. + [WirePath("lastAttemptDesiredVersion")] public string LastAttemptDesiredVersion { get; } /// Timestamp of last upgrade attempt. + [WirePath("lastAttemptTimestamp")] public DateTimeOffset? LastAttemptedOn { get; } /// Specifies the status of Agent Upgrade. + [WirePath("lastAttemptStatus")] public LastAttemptStatusEnum? LastAttemptStatus { get; } /// Failure message of last upgrade attempt if any. + [WirePath("lastAttemptMessage")] public string LastAttemptMessage { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/AvailablePatchCountByClassification.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/AvailablePatchCountByClassification.Serialization.cs index b501cda4104a0..5da02fd6ec1bd 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/AvailablePatchCountByClassification.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/AvailablePatchCountByClassification.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -222,6 +223,156 @@ internal static AvailablePatchCountByClassification DeserializeAvailablePatchCou 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(Security), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" security: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Security)) + { + builder.Append(" security: "); + builder.AppendLine($"{Security.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Critical), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" critical: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Critical)) + { + builder.Append(" critical: "); + builder.AppendLine($"{Critical.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Definition), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" definition: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Definition)) + { + builder.Append(" definition: "); + builder.AppendLine($"{Definition.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(UpdateRollup), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" updateRollup: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(UpdateRollup)) + { + builder.Append(" updateRollup: "); + builder.AppendLine($"{UpdateRollup.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(FeaturePack), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" featurePack: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(FeaturePack)) + { + builder.Append(" featurePack: "); + builder.AppendLine($"{FeaturePack.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ServicePack), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" servicePack: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ServicePack)) + { + builder.Append(" servicePack: "); + builder.AppendLine($"{ServicePack.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Tools), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" tools: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Tools)) + { + builder.Append(" tools: "); + builder.AppendLine($"{Tools.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Updates), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" updates: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Updates)) + { + builder.Append(" updates: "); + builder.AppendLine($"{Updates.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Other), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" other: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Other)) + { + builder.Append(" other: "); + builder.AppendLine($"{Other.Value}"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -230,6 +381,8 @@ BinaryData IPersistableModel.Write(ModelRea { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(AvailablePatchCountByClassification)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/AvailablePatchCountByClassification.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/AvailablePatchCountByClassification.cs index 9ba89d886508a..959f4554e4cf8 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/AvailablePatchCountByClassification.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/AvailablePatchCountByClassification.cs @@ -76,22 +76,31 @@ internal AvailablePatchCountByClassification(int? security, int? critical, int? } /// Number of security patches available for installation. + [WirePath("security")] public int? Security { get; } /// Number of critical patches available for installation. + [WirePath("critical")] public int? Critical { get; } /// Number of definition patches available for installation. + [WirePath("definition")] public int? Definition { get; } /// Number of update Rollup patches available for installation. + [WirePath("updateRollup")] public int? UpdateRollup { get; } /// Number of feature pack patches available for installation. + [WirePath("featurePack")] public int? FeaturePack { get; } /// Number of service pack patches available for installation. + [WirePath("servicePack")] public int? ServicePack { get; } /// Number of tools patches available for installation. + [WirePath("tools")] public int? Tools { get; } /// Number of updates category patches available for installation. + [WirePath("updates")] public int? Updates { get; } /// Number of other patches available for installation. + [WirePath("other")] public int? Other { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/EsuKey.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/EsuKey.Serialization.cs index edabb894555db..fb43022c36859 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/EsuKey.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/EsuKey.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -103,6 +104,59 @@ internal static EsuKey DeserializeEsuKey(JsonElement element, ModelReaderWriterO return new EsuKey(sku, licenseStatus, 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(Sku), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" sku: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Sku)) + { + builder.Append(" sku: "); + if (Sku.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Sku}'''"); + } + else + { + builder.AppendLine($"'{Sku}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LicenseStatus), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" licenseStatus: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LicenseStatus)) + { + builder.Append(" licenseStatus: "); + builder.AppendLine($"{LicenseStatus.Value}"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -111,6 +165,8 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(EsuKey)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/EsuKey.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/EsuKey.cs index e838f14f76c2e..692913b12b54b 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/EsuKey.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/EsuKey.cs @@ -62,8 +62,10 @@ internal EsuKey(string sku, int? licenseStatus, IDictionary } /// SKU number. + [WirePath("sku")] public string Sku { get; } /// The current status of the license profile key. Represented by the same integer value that is presented on the machine itself when querying the license key status. + [WirePath("licenseStatus")] public int? LicenseStatus { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionTargetProperties.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionTargetProperties.cs index de180803fa92d..1a3de4f5e7b15 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionTargetProperties.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionTargetProperties.cs @@ -60,6 +60,7 @@ internal ExtensionTargetProperties(string targetVersion, IDictionary Properties for the specified Extension to Upgrade. + [WirePath("targetVersion")] public string TargetVersion { get; set; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionValueListResult.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionValueListResult.Serialization.cs index d24c19615249f..e9ceee6e5b1e7 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionValueListResult.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionValueListResult.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; @@ -102,6 +104,44 @@ internal static ExtensionValueListResult DeserializeExtensionValueListResult(Jso return new ExtensionValueListResult(value ?? 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(Value), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" value: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Value)) + { + if (Value.Any()) + { + builder.Append(" value: "); + builder.AppendLine("["); + foreach (var item in Value) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " value: "); + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -110,6 +150,8 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOp { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(ExtensionValueListResult)} does not support writing '{options.Format}' format."); } 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 index 0b86ebd243224..f3319f866fa95 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionsResourceStatus.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionsResourceStatus.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -146,6 +147,121 @@ internal static ExtensionsResourceStatus DeserializeExtensionsResourceStatus(Jso 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; @@ -154,6 +270,8 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOp { 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."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionsResourceStatus.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionsResourceStatus.cs index 304e2658ca917..70e489109b5b6 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionsResourceStatus.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/ExtensionsResourceStatus.cs @@ -68,14 +68,19 @@ internal ExtensionsResourceStatus(string code, ExtensionsStatusLevelType? level, } /// 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/GatewayType.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewayType.cs deleted file mode 100644 index 006ab6207e9ff..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewayType.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 GatewayType : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public GatewayType(string value) - { - _value = value ?? throw new ArgumentNullException(nameof(value)); - } - - private const string PublicValue = "Public"; - - /// Public. - public static GatewayType Public { get; } = new GatewayType(PublicValue); - /// Determines if two values are the same. - public static bool operator ==(GatewayType left, GatewayType right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(GatewayType left, GatewayType right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator GatewayType(string value) => new GatewayType(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is GatewayType other && Equals(other); - /// - public bool Equals(GatewayType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 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/GatewaysListResult.Serialization.cs index 04ef8275cff3c..0866e51fe917d 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewaysListResult.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewaysListResult.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; @@ -76,7 +78,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(); @@ -84,10 +86,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(GatewayData.DeserializeGatewayData(item, options)); + array.Add(HybridComputeGatewayData.DeserializeHybridComputeGatewayData(item, options)); } value = array; continue; @@ -106,6 +108,67 @@ internal static GatewaysListResult DeserializeGatewaysListResult(JsonElement ele return new GatewaysListResult(value, 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; @@ -114,6 +177,8 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(GatewaysListResult)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewaysListResult.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewaysListResult.cs index 2f0b0d73e8d7c..3107e4575849d 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewaysListResult.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewaysListResult.cs @@ -49,7 +49,7 @@ internal partial class GatewaysListResult /// Initializes a new instance of . /// The list of Gateways. /// is null. - internal GatewaysListResult(IEnumerable value) + internal GatewaysListResult(IEnumerable value) { Argument.AssertNotNull(value, nameof(value)); @@ -60,7 +60,7 @@ internal GatewaysListResult(IEnumerable value) /// 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. /// Keeps track of any properties unknown to the library. - internal GatewaysListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal GatewaysListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; @@ -73,7 +73,7 @@ internal GatewaysListResult() } /// The list of Gateways. - public IReadOnlyList Value { get; } + 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. public string NextLink { get; } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HotpatchEnablementStatus.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HotpatchEnablementStatus.cs index 59c76373f06f8..341cc0dd4b54d 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HotpatchEnablementStatus.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HotpatchEnablementStatus.cs @@ -53,7 +53,7 @@ public HotpatchEnablementStatus(string value) /// [EditorBrowsable(EditorBrowsableState.Never)] - public override int GetHashCode() => _value?.GetHashCode() ?? 0; + 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/HybridComputeAccessRule.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeAccessRule.Serialization.cs index 6f702a661e5ef..cff9a4228c815 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeAccessRule.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeAccessRule.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; @@ -143,6 +145,98 @@ internal static HybridComputeAccessRule DeserializeHybridComputeAccessRule(JsonE return new HybridComputeAccessRule(name, direction, addressPrefixes ?? 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}'"); + } + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Direction), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" direction: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Direction)) + { + builder.Append(" direction: "); + builder.AppendLine($"'{Direction.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AddressPrefixes), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" addressPrefixes: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(AddressPrefixes)) + { + if (AddressPrefixes.Any()) + { + builder.Append(" addressPrefixes: "); + builder.AppendLine("["); + foreach (var item in AddressPrefixes) + { + 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; @@ -151,6 +245,8 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOpt { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(HybridComputeAccessRule)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeAccessRule.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeAccessRule.cs index e4bbfdcaa8b44..cea6595d383f9 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeAccessRule.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeAccessRule.cs @@ -65,10 +65,13 @@ internal HybridComputeAccessRule(string name, HybridComputeAccessRuleDirection? } /// Name of the access rule. + [WirePath("name")] public string Name { get; } /// Direction of the access rule. + [WirePath("properties.direction")] public HybridComputeAccessRuleDirection? Direction { get; } /// Address prefixes that are allowed access. + [WirePath("properties.addressPrefixes")] public IReadOnlyList AddressPrefixes { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeCloudMetadata.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeCloudMetadata.Serialization.cs index 373910d77fa80..a922538bad964 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeCloudMetadata.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeCloudMetadata.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -88,6 +89,44 @@ internal static HybridComputeCloudMetadata DeserializeHybridComputeCloudMetadata return new HybridComputeCloudMetadata(provider, 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(Provider), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provider: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Provider)) + { + builder.Append(" provider: "); + if (Provider.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Provider}'''"); + } + else + { + builder.AppendLine($"'{Provider}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -96,6 +135,8 @@ BinaryData IPersistableModel.Write(ModelReaderWriter { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(HybridComputeCloudMetadata)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeCloudMetadata.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeCloudMetadata.cs index 4a4f5cb1ea6b2..4023e24419058 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeCloudMetadata.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeCloudMetadata.cs @@ -60,6 +60,7 @@ internal HybridComputeCloudMetadata(string provider, IDictionary Specifies the cloud provider (Azure/AWS/GCP...). + [WirePath("provider")] public string Provider { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeConfigurationExtension.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeConfigurationExtension.Serialization.cs index 772b1983c8b90..2e9c06b69ade3 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeConfigurationExtension.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeConfigurationExtension.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -99,6 +100,67 @@ internal static HybridComputeConfigurationExtension DeserializeHybridComputeConf return new HybridComputeConfigurationExtension(publisher, type, 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(Publisher), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" publisher: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Publisher)) + { + builder.Append(" publisher: "); + if (Publisher.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Publisher}'''"); + } + else + { + builder.AppendLine($"'{Publisher}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ConfigurationExtensionType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" type: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ConfigurationExtensionType)) + { + builder.Append(" type: "); + if (ConfigurationExtensionType.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ConfigurationExtensionType}'''"); + } + else + { + builder.AppendLine($"'{ConfigurationExtensionType}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -107,6 +169,8 @@ BinaryData IPersistableModel.Write(ModelRea { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(HybridComputeConfigurationExtension)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeConfigurationExtension.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeConfigurationExtension.cs index 0a8f90a756630..34adde2d9e186 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeConfigurationExtension.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeConfigurationExtension.cs @@ -62,8 +62,10 @@ internal HybridComputeConfigurationExtension(string publisher, string configurat } /// Publisher of the extension. + [WirePath("publisher")] public string Publisher { get; } /// Type of the extension. + [WirePath("type")] public string ConfigurationExtensionType { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeConnectionDetail.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeConnectionDetail.Serialization.cs index 478856f62e89d..ca9ca16934411 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeConnectionDetail.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeConnectionDetail.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -142,6 +143,128 @@ internal static HybridComputeConnectionDetail DeserializeHybridComputeConnection serializedAdditionalRawData); } + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PrivateIPAddress), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" privateIpAddress: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PrivateIPAddress)) + { + builder.Append(" privateIpAddress: "); + if (PrivateIPAddress.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{PrivateIPAddress}'''"); + } + else + { + builder.AppendLine($"'{PrivateIPAddress}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LinkIdentifier), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" linkIdentifier: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LinkIdentifier)) + { + builder.Append(" linkIdentifier: "); + if (LinkIdentifier.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{LinkIdentifier}'''"); + } + else + { + builder.AppendLine($"'{LinkIdentifier}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(GroupId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" groupId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(GroupId)) + { + builder.Append(" groupId: "); + if (GroupId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{GroupId}'''"); + } + else + { + builder.AppendLine($"'{GroupId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MemberName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" memberName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MemberName)) + { + builder.Append(" memberName: "); + if (MemberName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{MemberName}'''"); + } + else + { + builder.AppendLine($"'{MemberName}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -150,6 +273,8 @@ BinaryData IPersistableModel.Write(ModelReaderWri { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(HybridComputeConnectionDetail)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeConnectionDetail.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeConnectionDetail.cs index defda0c80bc76..fc17712617a82 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeConnectionDetail.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeConnectionDetail.cs @@ -69,14 +69,19 @@ internal HybridComputeConnectionDetail(ResourceIdentifier id, string privateIPAd } /// Azure resource Id. + [WirePath("id")] public ResourceIdentifier Id { get; } /// The private endpoint connection private ip address. + [WirePath("privateIpAddress")] public string PrivateIPAddress { get; } /// The private endpoint connection link identifier. + [WirePath("linkIdentifier")] public string LinkIdentifier { get; } /// The private endpoint connection group id. + [WirePath("groupId")] public string GroupId { get; } /// The private endpoint connection member name. + [WirePath("memberName")] public string MemberName { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewayPatch.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeGatewayPatch.Serialization.cs similarity index 72% rename from sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewayPatch.Serialization.cs rename to sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeGatewayPatch.Serialization.cs index 7f4d1446e4c0f..97dcd7ef71034 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewayPatch.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeGatewayPatch.Serialization.cs @@ -13,16 +13,16 @@ namespace Azure.ResourceManager.HybridCompute.Models { - public partial class GatewayPatch : IUtf8JsonSerializable, IJsonModel + public partial class HybridComputeGatewayPatch : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(GatewayPatch)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(HybridComputeGatewayPatch)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -68,19 +68,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpti writer.WriteEndObject(); } - GatewayPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + HybridComputeGatewayPatch 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(GatewayPatch)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(HybridComputeGatewayPatch)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeGatewayPatch(document.RootElement, options); + return DeserializeHybridComputeGatewayPatch(document.RootElement, options); } - internal static GatewayPatch DeserializeGatewayPatch(JsonElement element, ModelReaderWriterOptions options = null) + internal static HybridComputeGatewayPatch DeserializeHybridComputeGatewayPatch(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -140,38 +140,38 @@ internal static GatewayPatch DeserializeGatewayPatch(JsonElement element, ModelR } } serializedAdditionalRawData = rawDataDictionary; - return new GatewayPatch(tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, allowedFeatures ?? new ChangeTrackingList()); + return new HybridComputeGatewayPatch(tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData, allowedFeatures ?? new ChangeTrackingList()); } - 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(GatewayPatch)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(HybridComputeGatewayPatch)} does not support writing '{options.Format}' format."); } } - GatewayPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + HybridComputeGatewayPatch 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 DeserializeGatewayPatch(document.RootElement, options); + return DeserializeHybridComputeGatewayPatch(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(GatewayPatch)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(HybridComputeGatewayPatch)} 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/GatewayPatch.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeGatewayPatch.cs similarity index 60% rename from sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewayPatch.cs rename to sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeGatewayPatch.cs index d4e2003431263..8912c0a329dd7 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/GatewayPatch.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeGatewayPatch.cs @@ -11,24 +11,25 @@ namespace Azure.ResourceManager.HybridCompute.Models { /// Describes a License Update. - public partial class GatewayPatch : HybridComputeResourceUpdate + public partial class HybridComputeGatewayPatch : HybridComputeResourceUpdate { - /// Initializes a new instance of . - public GatewayPatch() + /// Initializes a new instance of . + public HybridComputeGatewayPatch() { AllowedFeatures = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// 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 GatewayPatch(IDictionary tags, IDictionary serializedAdditionalRawData, IList allowedFeatures) : base(tags, serializedAdditionalRawData) + 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 new file mode 100644 index 0000000000000..5744d61890379 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeGatewayType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.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 string 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/HybridComputeIPAddress.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeIPAddress.Serialization.cs index 421d813a10d7b..8ea18f4a48a8f 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeIPAddress.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeIPAddress.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -114,6 +115,85 @@ internal static HybridComputeIPAddress DeserializeHybridComputeIPAddress(JsonEle return new HybridComputeIPAddress(address, ipAddressVersion, subnet, 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(Address), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" address: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Address)) + { + builder.Append(" address: "); + if (Address.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Address}'''"); + } + else + { + builder.AppendLine($"'{Address}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IPAddressVersion), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" ipAddressVersion: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IPAddressVersion)) + { + builder.Append(" ipAddressVersion: "); + if (IPAddressVersion.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{IPAddressVersion}'''"); + } + else + { + builder.AppendLine($"'{IPAddressVersion}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue("SubnetAddressPrefix", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" subnet: "); + builder.AppendLine("{"); + builder.Append(" addressPrefix: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(Subnet)) + { + builder.Append(" subnet: "); + BicepSerializationHelpers.AppendChildObject(builder, Subnet, options, 2, false, " subnet: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -122,6 +202,8 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOpti { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(HybridComputeIPAddress)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeIPAddress.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeIPAddress.cs index b6923b8a08fbc..93f199eb8d310 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeIPAddress.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeIPAddress.cs @@ -64,12 +64,15 @@ internal HybridComputeIPAddress(string address, string ipAddressVersion, HybridC } /// Represents the IP Address. + [WirePath("address")] public string Address { get; } /// Represents the Ip Address Version. + [WirePath("ipAddressVersion")] public string IPAddressVersion { get; } /// The subnet to which this IP address belongs. internal HybridComputeSubnet Subnet { get; } /// Represents address prefix. + [WirePath("subnet.addressPrefix")] public string SubnetAddressPrefix { get => Subnet?.AddressPrefix; diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLicenseDetails.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLicenseDetails.Serialization.cs index 6e8c2fa9f43d5..b594e5b2a8d58 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLicenseDetails.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLicenseDetails.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; @@ -212,6 +214,157 @@ internal static HybridComputeLicenseDetails DeserializeHybridComputeLicenseDetai 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(State), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" state: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(State)) + { + builder.Append(" state: "); + builder.AppendLine($"'{State.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Target), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" target: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Target)) + { + builder.Append(" target: "); + builder.AppendLine($"'{Target.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Edition), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" edition: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Edition)) + { + builder.Append(" edition: "); + builder.AppendLine($"'{Edition.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LicenseCoreType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" type: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LicenseCoreType)) + { + builder.Append(" type: "); + builder.AppendLine($"'{LicenseCoreType.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Processors), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" processors: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Processors)) + { + builder.Append(" processors: "); + builder.AppendLine($"{Processors.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AssignedLicenses), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" assignedLicenses: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AssignedLicenses)) + { + builder.Append(" assignedLicenses: "); + builder.AppendLine($"{AssignedLicenses.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ImmutableId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" immutableId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ImmutableId)) + { + builder.Append(" immutableId: "); + if (ImmutableId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ImmutableId}'''"); + } + else + { + builder.AppendLine($"'{ImmutableId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(VolumeLicenseDetails), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" volumeLicenseDetails: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(VolumeLicenseDetails)) + { + if (VolumeLicenseDetails.Any()) + { + builder.Append(" volumeLicenseDetails: "); + builder.AppendLine("["); + foreach (var item in VolumeLicenseDetails) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " volumeLicenseDetails: "); + } + 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; @@ -220,6 +373,8 @@ BinaryData IPersistableModel.Write(ModelReaderWrite { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(HybridComputeLicenseDetails)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLicenseDetails.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLicenseDetails.cs index 219ee734dc509..167440b82eb67 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLicenseDetails.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLicenseDetails.cs @@ -75,20 +75,28 @@ internal HybridComputeLicenseDetails(HybridComputeLicenseState? state, HybridCom } /// Describes the state of the license. + [WirePath("state")] public HybridComputeLicenseState? State { get; set; } /// Describes the license target server. + [WirePath("target")] public HybridComputeLicenseTarget? Target { get; set; } /// Describes the edition of the license. The values are either Standard or Datacenter. + [WirePath("edition")] public HybridComputeLicenseEdition? Edition { get; set; } /// Describes the license core type (pCore or vCore). + [WirePath("type")] public LicenseCoreType? LicenseCoreType { get; set; } /// Describes the number of processors. + [WirePath("processors")] public int? Processors { get; set; } /// Describes the number of assigned licenses. + [WirePath("assignedLicenses")] public int? AssignedLicenses { get; } /// Describes the immutable id. + [WirePath("immutableId")] public string ImmutableId { get; } /// A list of volume license details. + [WirePath("volumeLicenseDetails")] public IList VolumeLicenseDetails { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLinuxConfiguration.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLinuxConfiguration.Serialization.cs index 9b8e1c58e3bd2..00b33f09eaef9 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLinuxConfiguration.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLinuxConfiguration.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -38,10 +39,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo writer.WritePropertyName("patchMode"u8); writer.WriteStringValue(PatchMode.Value.ToString()); } - if (Optional.IsDefined(EnableHotpatching)) + if (Optional.IsDefined(IsHotpatchingEnabled)) { writer.WritePropertyName("enableHotpatching"u8); - writer.WriteBooleanValue(EnableHotpatching.Value); + writer.WriteBooleanValue(IsHotpatchingEnabled.Value); } if (options.Format != "W" && Optional.IsDefined(Status)) { @@ -90,7 +91,7 @@ internal static HybridComputeLinuxConfiguration DeserializeHybridComputeLinuxCon AssessmentModeType? assessmentMode = default; PatchModeType? patchMode = default; bool? enableHotpatching = default; - PatchSettingsStatus status = default; + HybridComputePatchSettingsStatus status = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -137,7 +138,7 @@ internal static HybridComputeLinuxConfiguration DeserializeHybridComputeLinuxCon { continue; } - status = PatchSettingsStatus.DeserializePatchSettingsStatus(property0.Value, options); + status = HybridComputePatchSettingsStatus.DeserializeHybridComputePatchSettingsStatus(property0.Value, options); continue; } } @@ -152,6 +153,85 @@ internal static HybridComputeLinuxConfiguration DeserializeHybridComputeLinuxCon return new HybridComputeLinuxConfiguration(assessmentMode, patchMode, enableHotpatching, status, serializedAdditionalRawData); } + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + builder.Append(" patchSettings:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AssessmentMode), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" assessmentMode: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AssessmentMode)) + { + builder.Append(" assessmentMode: "); + builder.AppendLine($"'{AssessmentMode.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PatchMode), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" patchMode: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PatchMode)) + { + builder.Append(" patchMode: "); + builder.AppendLine($"'{PatchMode.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsHotpatchingEnabled), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" enableHotpatching: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IsHotpatchingEnabled)) + { + builder.Append(" enableHotpatching: "); + var boolValue = IsHotpatchingEnabled.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Status), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" status: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Status)) + { + builder.Append(" status: "); + BicepSerializationHelpers.AppendChildObject(builder, Status, options, 4, false, " status: "); + } + } + + 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; @@ -160,6 +240,8 @@ BinaryData IPersistableModel.Write(ModelReaderW { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(HybridComputeLinuxConfiguration)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLinuxConfiguration.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLinuxConfiguration.cs index bab2eed47220c..db82aae1d2776 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLinuxConfiguration.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLinuxConfiguration.cs @@ -53,25 +53,29 @@ public HybridComputeLinuxConfiguration() /// 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. + /// 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. /// Keeps track of any properties unknown to the library. - internal HybridComputeLinuxConfiguration(AssessmentModeType? assessmentMode, PatchModeType? patchMode, bool? enableHotpatching, PatchSettingsStatus status, IDictionary serializedAdditionalRawData) + internal HybridComputeLinuxConfiguration(AssessmentModeType? assessmentMode, PatchModeType? patchMode, bool? isHotpatchingEnabled, HybridComputePatchSettingsStatus status, IDictionary serializedAdditionalRawData) { AssessmentMode = assessmentMode; PatchMode = patchMode; - EnableHotpatching = enableHotpatching; + IsHotpatchingEnabled = isHotpatchingEnabled; Status = status; _serializedAdditionalRawData = serializedAdditionalRawData; } /// Specifies the assessment mode. + [WirePath("patchSettings.assessmentMode")] public AssessmentModeType? AssessmentMode { get; set; } /// Specifies the patch mode. + [WirePath("patchSettings.patchMode")] public PatchModeType? PatchMode { get; set; } /// Captures the hotpatch capability enrollment intent of the customers, which enables customers to patch their Windows machines without requiring a reboot. - public bool? EnableHotpatching { get; set; } + [WirePath("patchSettings.enableHotpatching")] + public bool? IsHotpatchingEnabled { get; set; } /// Status of the hotpatch capability enrollment or disenrollment. - public PatchSettingsStatus Status { get; } + [WirePath("patchSettings.status")] + public HybridComputePatchSettingsStatus Status { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLinuxParameters.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLinuxParameters.cs index d3321efcb4da6..ddcf82172b5a7 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLinuxParameters.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLinuxParameters.cs @@ -67,10 +67,13 @@ internal HybridComputeLinuxParameters(IList cla } /// The update classifications to select when installing patches for Linux. + [WirePath("classificationsToInclude")] public IList ClassificationsToInclude { get; } /// packages to include in the patch operation. Format: packageName_packageVersion. + [WirePath("packageNameMasksToInclude")] public IList PackageNameMasksToInclude { get; } /// packages to exclude in the patch operation. Format: packageName_packageVersion. + [WirePath("packageNameMasksToExclude")] public IList PackageNameMasksToExclude { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLocation.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLocation.Serialization.cs index 9b7ba79d0e12f..5ccfec744ac7a 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLocation.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLocation.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -118,6 +119,113 @@ internal static HybridComputeLocation DeserializeHybridComputeLocation(JsonEleme return new HybridComputeLocation(name, city, district, countryOrRegion, 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(City), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" city: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(City)) + { + builder.Append(" city: "); + if (City.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{City}'''"); + } + else + { + builder.AppendLine($"'{City}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(District), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" district: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(District)) + { + builder.Append(" district: "); + if (District.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{District}'''"); + } + else + { + builder.AppendLine($"'{District}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CountryOrRegion), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" countryOrRegion: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CountryOrRegion)) + { + builder.Append(" countryOrRegion: "); + if (CountryOrRegion.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{CountryOrRegion}'''"); + } + else + { + builder.AppendLine($"'{CountryOrRegion}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -126,6 +234,8 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptio { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(HybridComputeLocation)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLocation.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLocation.cs index b71dd36a80d1d..89fcec21a5f34 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLocation.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLocation.cs @@ -76,12 +76,16 @@ internal HybridComputeLocation() } /// A canonical name for the geographic or physical location. + [WirePath("name")] public string Name { get; set; } /// The city or locality where the resource is located. + [WirePath("city")] public string City { get; set; } /// The district, state, or province where the resource is located. + [WirePath("district")] public string District { get; set; } /// The country or region where the resource is located. + [WirePath("countryOrRegion")] public string CountryOrRegion { get; set; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachineExtensionPatch.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachineExtensionPatch.cs index 5cb6417566ed4..05890a0dbb78d 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachineExtensionPatch.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachineExtensionPatch.cs @@ -44,16 +44,22 @@ internal HybridComputeMachineExtensionPatch(IDictionary tags, ID } /// How the extension handler should be forced to update even if the extension configuration has not changed. + [WirePath("properties.forceUpdateTag")] public string ForceUpdateTag { get; set; } /// The name of the extension handler publisher. + [WirePath("properties.publisher")] public string Publisher { get; set; } /// Specifies the type of the extension; an example is "CustomScriptExtension". + [WirePath("properties.type")] public string MachineExtensionUpdatePropertiesType { get; set; } /// Specifies the version of the script handler. + [WirePath("properties.typeHandlerVersion")] public string TypeHandlerVersion { get; set; } /// Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available. + [WirePath("properties.enableAutomaticUpgrade")] public bool? EnableAutomaticUpgrade { get; set; } /// Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. + [WirePath("properties.autoUpgradeMinorVersion")] public bool? AutoUpgradeMinorVersion { get; set; } /// /// Json formatted public settings for the extension. @@ -85,6 +91,7 @@ internal HybridComputeMachineExtensionPatch(IDictionary tags, ID /// /// /// + [WirePath("properties.settings")] public IDictionary Settings { get; } /// /// The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. @@ -116,6 +123,7 @@ internal HybridComputeMachineExtensionPatch(IDictionary tags, ID /// /// /// + [WirePath("properties.protectedSettings")] public IDictionary ProtectedSettings { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachinePatch.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachinePatch.cs index 6d125a87536fa..e7b6f3c6ad578 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachinePatch.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeMachinePatch.cs @@ -44,26 +44,34 @@ internal HybridComputeMachinePatch(IDictionary tags, IDictionary } /// Identity for the resource. Current supported identity types: SystemAssigned. + [WirePath("identity")] public ManagedServiceIdentity Identity { get; set; } /// Indicates which kind of Arc machine placement on-premises, such as HCI, SCVMM or VMware etc. + [WirePath("kind")] public ArcKindEnum? Kind { get; set; } /// Metadata pertaining to the geographic location of the resource. + [WirePath("properties.locationData")] public HybridComputeLocation LocationData { get; set; } /// Specifies the operating system settings for the hybrid machine. + [WirePath("properties.osProfile")] public HybridComputeOSProfile OSProfile { get; set; } /// The metadata of the cloud environment (Azure/GCP/AWS/OCI...). internal HybridComputeCloudMetadata CloudMetadata { get; set; } /// Specifies the cloud provider (Azure/AWS/GCP...). + [WirePath("properties.cloudMetadata.provider")] public string CloudMetadataProvider { get => CloudMetadata is null ? default : CloudMetadata.Provider; } /// The info of the machine w.r.t Agent Upgrade. + [WirePath("properties.agentUpgrade")] public AgentUpgrade AgentUpgrade { get; set; } /// The resource id of the parent cluster (Azure HCI) this machine is assigned to, if any. + [WirePath("properties.parentClusterResourceId")] public ResourceIdentifier ParentClusterResourceId { get; set; } /// The resource id of the private link scope this machine is assigned to, if any. + [WirePath("properties.privateLinkScopeResourceId")] public ResourceIdentifier PrivateLinkScopeResourceId { get; set; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeNetworkInterface.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeNetworkInterface.Serialization.cs index 84693d57ee586..d3c2e6b2ea9f7 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeNetworkInterface.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeNetworkInterface.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; @@ -102,6 +104,44 @@ internal static HybridComputeNetworkInterface DeserializeHybridComputeNetworkInt return new HybridComputeNetworkInterface(ipAddresses ?? 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(IPAddresses), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" ipAddresses: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(IPAddresses)) + { + if (IPAddresses.Any()) + { + builder.Append(" ipAddresses: "); + builder.AppendLine("["); + foreach (var item in IPAddresses) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " ipAddresses: "); + } + 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; @@ -110,6 +150,8 @@ BinaryData IPersistableModel.Write(ModelReaderWri { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(HybridComputeNetworkInterface)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeNetworkInterface.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeNetworkInterface.cs index 5c084f994faee..6ab24bc2b696b 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeNetworkInterface.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeNetworkInterface.cs @@ -61,6 +61,7 @@ internal HybridComputeNetworkInterface(IReadOnlyList ipA } /// The list of IP addresses in this interface. + [WirePath("ipAddresses")] public IReadOnlyList IPAddresses { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeNetworkProfile.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeNetworkProfile.Serialization.cs index 5248aae574ce2..c97700e9f1654 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeNetworkProfile.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeNetworkProfile.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; @@ -102,6 +104,44 @@ internal static HybridComputeNetworkProfile DeserializeHybridComputeNetworkProfi return new HybridComputeNetworkProfile(networkInterfaces ?? 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(NetworkInterfaces), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" networkInterfaces: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(NetworkInterfaces)) + { + if (NetworkInterfaces.Any()) + { + builder.Append(" networkInterfaces: "); + builder.AppendLine("["); + foreach (var item in NetworkInterfaces) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " networkInterfaces: "); + } + 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; @@ -110,6 +150,8 @@ BinaryData IPersistableModel.Write(ModelReaderWrite { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(HybridComputeNetworkProfile)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeNetworkProfile.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeNetworkProfile.cs index 4cdea74052f1b..2b7746587767d 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeNetworkProfile.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeNetworkProfile.cs @@ -61,6 +61,7 @@ internal HybridComputeNetworkProfile(IReadOnlyList The list of network interfaces. + [WirePath("networkInterfaces")] public IReadOnlyList NetworkInterfaces { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeOSProfile.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeOSProfile.Serialization.cs index 904c3c0ad4be4..7533936242e94 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeOSProfile.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeOSProfile.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -118,6 +119,74 @@ internal static HybridComputeOSProfile DeserializeHybridComputeOSProfile(JsonEle return new HybridComputeOSProfile(computerName, windowsConfiguration, linuxConfiguration, 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(ComputerName), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" computerName: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ComputerName)) + { + builder.Append(" computerName: "); + if (ComputerName.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ComputerName}'''"); + } + else + { + builder.AppendLine($"'{ComputerName}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(WindowsConfiguration), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" windowsConfiguration: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(WindowsConfiguration)) + { + builder.Append(" windowsConfiguration: "); + BicepSerializationHelpers.AppendChildObject(builder, WindowsConfiguration, options, 2, false, " windowsConfiguration: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LinuxConfiguration), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" linuxConfiguration: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LinuxConfiguration)) + { + builder.Append(" linuxConfiguration: "); + BicepSerializationHelpers.AppendChildObject(builder, LinuxConfiguration, options, 2, false, " linuxConfiguration: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -126,6 +195,8 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOpti { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(HybridComputeOSProfile)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeOSProfile.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeOSProfile.cs index 02746d8221705..5fe9c1e4f1460 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeOSProfile.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeOSProfile.cs @@ -64,10 +64,13 @@ internal HybridComputeOSProfile(string computerName, HybridComputeWindowsConfigu } /// Specifies the host OS name of the hybrid machine. + [WirePath("computerName")] public string ComputerName { get; } /// Specifies the windows configuration for update management. + [WirePath("windowsConfiguration")] public HybridComputeWindowsConfiguration WindowsConfiguration { get; set; } /// Specifies the linux configuration for update management. + [WirePath("linuxConfiguration")] public HybridComputeLinuxConfiguration LinuxConfiguration { get; set; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePatchSettingsStatus.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePatchSettingsStatus.Serialization.cs new file mode 100644 index 0000000000000..0a96fc9b361f8 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePatchSettingsStatus.Serialization.cs @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.HybridCompute.Models +{ + public partial class HybridComputePatchSettingsStatus : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HybridComputePatchSettingsStatus)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsDefined(HotpatchEnablementStatus)) + { + writer.WritePropertyName("hotpatchEnablementStatus"u8); + writer.WriteStringValue(HotpatchEnablementStatus.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + JsonSerializer.Serialize(writer, Error); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + HybridComputePatchSettingsStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HybridComputePatchSettingsStatus)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHybridComputePatchSettingsStatus(document.RootElement, options); + } + + internal static HybridComputePatchSettingsStatus DeserializeHybridComputePatchSettingsStatus(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + HotpatchEnablementStatus? hotpatchEnablementStatus = default; + ResponseError error = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("hotpatchEnablementStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + hotpatchEnablementStatus = new HotpatchEnablementStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("error"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HybridComputePatchSettingsStatus(hotpatchEnablementStatus, error, 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(HotpatchEnablementStatus), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" hotpatchEnablementStatus: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(HotpatchEnablementStatus)) + { + builder.Append(" hotpatchEnablementStatus: "); + builder.AppendLine($"'{HotpatchEnablementStatus.Value.ToString()}'"); + } + } + + 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, 2, false, " error: "); + } + } + + 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(HybridComputePatchSettingsStatus)} does not support writing '{options.Format}' format."); + } + } + + HybridComputePatchSettingsStatus 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 DeserializeHybridComputePatchSettingsStatus(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HybridComputePatchSettingsStatus)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PatchSettingsStatus.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePatchSettingsStatus.cs similarity index 81% rename from sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PatchSettingsStatus.cs rename to sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePatchSettingsStatus.cs index 6b3be95978d19..5b722d4da27f4 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PatchSettingsStatus.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePatchSettingsStatus.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.HybridCompute.Models { /// Status of the hotpatch capability enrollment or disenrollment. - public partial class PatchSettingsStatus + public partial class HybridComputePatchSettingsStatus { /// /// Keeps track of any properties unknown to the library. @@ -45,16 +45,16 @@ public partial class PatchSettingsStatus /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal PatchSettingsStatus() + /// Initializes a new instance of . + internal HybridComputePatchSettingsStatus() { } - /// Initializes a new instance of . + /// 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. /// Keeps track of any properties unknown to the library. - internal PatchSettingsStatus(HotpatchEnablementStatus? hotpatchEnablementStatus, ResponseError error, IDictionary serializedAdditionalRawData) + internal HybridComputePatchSettingsStatus(HotpatchEnablementStatus? hotpatchEnablementStatus, ResponseError error, IDictionary serializedAdditionalRawData) { HotpatchEnablementStatus = hotpatchEnablementStatus; Error = error; @@ -62,8 +62,10 @@ internal PatchSettingsStatus(HotpatchEnablementStatus? hotpatchEnablementStatus, } /// Indicates the current status of the hotpatch being enabled or disabled. + [WirePath("hotpatchEnablementStatus")] public HotpatchEnablementStatus? HotpatchEnablementStatus { get; } /// The errors that were encountered during the hotpatch capability enrollment or disenrollment. + [WirePath("error")] public ResponseError Error { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateEndpointConnectionListResult.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateEndpointConnectionListResult.Serialization.cs index 71e26b693faf6..1a1a74ffcccf3 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateEndpointConnectionListResult.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateEndpointConnectionListResult.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; @@ -113,6 +115,67 @@ internal static HybridComputePrivateEndpointConnectionListResult DeserializeHybr return new HybridComputePrivateEndpointConnectionListResult(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; @@ -121,6 +184,8 @@ BinaryData IPersistableModel.W { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(HybridComputePrivateEndpointConnectionListResult)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateEndpointConnectionProperties.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateEndpointConnectionProperties.Serialization.cs index 27a04002966a4..319ed3656678b 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateEndpointConnectionProperties.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateEndpointConnectionProperties.Serialization.cs @@ -8,6 +8,8 @@ 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.Resources.Models; @@ -144,6 +146,113 @@ internal static HybridComputePrivateEndpointConnectionProperties DeserializeHybr return new HybridComputePrivateEndpointConnectionProperties(privateEndpoint, privateLinkServiceConnectionState, provisioningState, groupIds ?? 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("PrivateEndpointId", out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" privateEndpoint: "); + builder.AppendLine("{"); + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + builder.AppendLine(" }"); + } + else + { + if (Optional.IsDefined(PrivateEndpoint)) + { + builder.Append(" privateEndpoint: "); + BicepSerializationHelpers.AppendChildObject(builder, PrivateEndpoint, options, 2, false, " privateEndpoint: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ConnectionState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" privateLinkServiceConnectionState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ConnectionState)) + { + builder.Append(" privateLinkServiceConnectionState: "); + BicepSerializationHelpers.AppendChildObject(builder, ConnectionState, options, 2, false, " privateLinkServiceConnectionState: "); + } + } + + 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(GroupIds), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" groupIds: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(GroupIds)) + { + if (GroupIds.Any()) + { + builder.Append(" groupIds: "); + builder.AppendLine("["); + foreach (var item in GroupIds) + { + 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("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -152,6 +261,8 @@ BinaryData IPersistableModel.W { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(HybridComputePrivateEndpointConnectionProperties)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateEndpointConnectionProperties.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateEndpointConnectionProperties.cs index 832ce88beea15..1982643b3e35b 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateEndpointConnectionProperties.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateEndpointConnectionProperties.cs @@ -71,6 +71,7 @@ internal HybridComputePrivateEndpointConnectionProperties(WritableSubResource pr /// Private endpoint which the connection belongs to. internal WritableSubResource PrivateEndpoint { get; set; } /// Gets or sets Id. + [WirePath("privateEndpoint.id")] public ResourceIdentifier PrivateEndpointId { get => PrivateEndpoint is null ? default : PrivateEndpoint.Id; @@ -83,10 +84,13 @@ public ResourceIdentifier PrivateEndpointId } /// Connection state of the private endpoint connection. + [WirePath("privateLinkServiceConnectionState")] public HybridComputePrivateLinkServiceConnectionStateProperty ConnectionState { get; set; } /// State of the private endpoint connection. + [WirePath("provisioningState")] public string ProvisioningState { get; } /// List of group IDs. + [WirePath("groupIds")] public IReadOnlyList GroupIds { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateLinkResourceListResult.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateLinkResourceListResult.Serialization.cs index d8a7dafea0a98..af5794f314b40 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateLinkResourceListResult.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateLinkResourceListResult.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; @@ -113,6 +115,67 @@ internal static HybridComputePrivateLinkResourceListResult DeserializeHybridComp return new HybridComputePrivateLinkResourceListResult(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; @@ -121,6 +184,8 @@ BinaryData IPersistableModel.Write(M { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(HybridComputePrivateLinkResourceListResult)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateLinkResourceProperties.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateLinkResourceProperties.Serialization.cs index 88fea252b2d16..2c719ee1c5eef 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateLinkResourceProperties.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateLinkResourceProperties.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; @@ -138,6 +140,116 @@ internal static HybridComputePrivateLinkResourceProperties DeserializeHybridComp return new HybridComputePrivateLinkResourceProperties(groupId, requiredMembers ?? new ChangeTrackingList(), requiredZoneNames ?? 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(GroupId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" groupId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(GroupId)) + { + builder.Append(" groupId: "); + if (GroupId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{GroupId}'''"); + } + else + { + builder.AppendLine($"'{GroupId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RequiredMembers), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" requiredMembers: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(RequiredMembers)) + { + if (RequiredMembers.Any()) + { + builder.Append(" requiredMembers: "); + builder.AppendLine("["); + foreach (var item in RequiredMembers) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RequiredZoneNames), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" requiredZoneNames: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(RequiredZoneNames)) + { + if (RequiredZoneNames.Any()) + { + builder.Append(" requiredZoneNames: "); + builder.AppendLine("["); + foreach (var item in RequiredZoneNames) + { + 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("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -146,6 +258,8 @@ BinaryData IPersistableModel.Write(M { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(HybridComputePrivateLinkResourceProperties)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateLinkResourceProperties.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateLinkResourceProperties.cs index 0a60f243e93ba..f74d18d420f66 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateLinkResourceProperties.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateLinkResourceProperties.cs @@ -66,10 +66,13 @@ internal HybridComputePrivateLinkResourceProperties(string groupId, IReadOnlyLis } /// The private link resource group id. + [WirePath("groupId")] public string GroupId { get; } /// The private link resource required member names. + [WirePath("requiredMembers")] public IReadOnlyList RequiredMembers { get; } /// Required DNS zone names of the the private link resource. + [WirePath("requiredZoneNames")] public IReadOnlyList RequiredZoneNames { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateLinkScopeListResult.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateLinkScopeListResult.Serialization.cs index 7b82a66b8b83d..c5714b12cc80a 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateLinkScopeListResult.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateLinkScopeListResult.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; @@ -106,6 +108,67 @@ internal static HybridComputePrivateLinkScopeListResult DeserializeHybridCompute return new HybridComputePrivateLinkScopeListResult(value, 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; @@ -114,6 +177,8 @@ BinaryData IPersistableModel.Write(Mode { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(HybridComputePrivateLinkScopeListResult)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateLinkScopePatch.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateLinkScopePatch.cs index a70f93b52146a..48a2963173e1a 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateLinkScopePatch.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateLinkScopePatch.cs @@ -61,6 +61,7 @@ internal HybridComputePrivateLinkScopePatch(IDictionary tags, ID } /// Resource tags. + [WirePath("tags")] public IDictionary Tags { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateLinkScopeProperties.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateLinkScopeProperties.Serialization.cs index dd168f99a864c..b4836668e1b7d 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateLinkScopeProperties.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateLinkScopeProperties.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; @@ -139,6 +141,105 @@ internal static HybridComputePrivateLinkScopeProperties DeserializeHybridCompute return new HybridComputePrivateLinkScopeProperties(publicNetworkAccess, provisioningState, privateLinkScopeId, privateEndpointConnections ?? 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(PublicNetworkAccess), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" publicNetworkAccess: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PublicNetworkAccess)) + { + builder.Append(" publicNetworkAccess: "); + builder.AppendLine($"'{PublicNetworkAccess.Value.ToString()}'"); + } + } + + 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(PrivateLinkScopeId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" privateLinkScopeId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PrivateLinkScopeId)) + { + builder.Append(" privateLinkScopeId: "); + if (PrivateLinkScopeId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{PrivateLinkScopeId}'''"); + } + else + { + builder.AppendLine($"'{PrivateLinkScopeId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PrivateEndpointConnections), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" privateEndpointConnections: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(PrivateEndpointConnections)) + { + if (PrivateEndpointConnections.Any()) + { + builder.Append(" privateEndpointConnections: "); + builder.AppendLine("["); + foreach (var item in PrivateEndpointConnections) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " privateEndpointConnections: "); + } + 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; @@ -147,6 +248,8 @@ BinaryData IPersistableModel.Write(Mode { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(HybridComputePrivateLinkScopeProperties)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateLinkScopeProperties.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateLinkScopeProperties.cs index 00d144c536cc3..3d42a352b199c 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateLinkScopeProperties.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateLinkScopeProperties.cs @@ -67,12 +67,16 @@ internal HybridComputePrivateLinkScopeProperties(HybridComputePublicNetworkAcces } /// Indicates whether machines associated with the private link scope can also use public Azure Arc service endpoints. + [WirePath("publicNetworkAccess")] public HybridComputePublicNetworkAccessType? PublicNetworkAccess { get; set; } /// Current state of this PrivateLinkScope: whether or not is has been provisioned within the resource group it is defined. Users cannot change this value but are able to read from it. Values will include Provisioning ,Succeeded, Canceled and Failed. + [WirePath("provisioningState")] public string ProvisioningState { get; } /// The Guid id of the private link scope. + [WirePath("privateLinkScopeId")] public string PrivateLinkScopeId { get; } /// The collection of associated Private Endpoint Connections. + [WirePath("privateEndpointConnections")] public IReadOnlyList PrivateEndpointConnections { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateLinkServiceConnectionStateProperty.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateLinkServiceConnectionStateProperty.Serialization.cs index 91b610f675aa1..da971e6220305 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateLinkServiceConnectionStateProperty.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputePrivateLinkServiceConnectionStateProperty.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -104,6 +105,90 @@ internal static HybridComputePrivateLinkServiceConnectionStateProperty Deseriali return new HybridComputePrivateLinkServiceConnectionStateProperty(status, description, actionsRequired, serializedAdditionalRawData); } + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Status), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" status: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Status)) + { + builder.Append(" status: "); + if (Status.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Status}'''"); + } + else + { + builder.AppendLine($"'{Status}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Description), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" description: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Description)) + { + builder.Append(" description: "); + if (Description.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Description}'''"); + } + else + { + builder.AppendLine($"'{Description}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ActionsRequired), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" actionsRequired: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ActionsRequired)) + { + builder.Append(" actionsRequired: "); + if (ActionsRequired.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ActionsRequired}'''"); + } + else + { + builder.AppendLine($"'{ActionsRequired}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -112,6 +197,8 @@ BinaryData IPersistableModel The private link service connection status. + [WirePath("status")] public string Status { get; set; } /// The private link service connection description. + [WirePath("description")] public string Description { get; set; } /// The actions required for private link service connection. + [WirePath("actionsRequired")] public string ActionsRequired { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeProductFeature.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeProductFeature.Serialization.cs index b77b819f24e2f..6c718f0621668 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeProductFeature.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeProductFeature.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -186,6 +187,138 @@ internal static HybridComputeProductFeature DeserializeHybridComputeProductFeatu 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(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(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, 2, false, " error: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -194,6 +327,8 @@ BinaryData IPersistableModel.Write(ModelReaderWrite { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(HybridComputeProductFeature)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeProductFeature.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeProductFeature.cs index c769b09420af8..6eb441c53cb0b 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeProductFeature.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeProductFeature.cs @@ -72,18 +72,25 @@ internal HybridComputeProductFeature(string name, LicenseProfileSubscriptionStat } /// Product feature name. + [WirePath("name")] public string Name { get; set; } /// Indicates the current status of the product features. + [WirePath("subscriptionStatus")] public LicenseProfileSubscriptionStatus? SubscriptionStatus { get; set; } /// The timestamp in UTC when the user enrolls the feature. + [WirePath("enrollmentDate")] public DateTimeOffset? EnrollmentOn { get; } /// The timestamp in UTC when the billing starts. + [WirePath("billingStartDate")] public DateTimeOffset? BillingStartOn { get; } /// The timestamp in UTC when the user disenrolled the feature. + [WirePath("disenrollmentDate")] public DateTimeOffset? DisenrollmentOn { get; } /// The timestamp in UTC when the billing ends. + [WirePath("billingEndDate")] public DateTimeOffset? BillingEndOn { get; } /// The errors that were encountered during the feature enrollment or disenrollment. + [WirePath("error")] public ResponseError Error { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeProvisioningIssue.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeProvisioningIssue.Serialization.cs index c24d188f75f53..72fdf20101f63 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeProvisioningIssue.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeProvisioningIssue.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; @@ -201,6 +203,159 @@ internal static HybridComputeProvisioningIssue DeserializeHybridComputeProvision 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}'"); + } + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IssueType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" issueType: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IssueType)) + { + builder.Append(" issueType: "); + builder.AppendLine($"'{IssueType.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Severity), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" severity: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Severity)) + { + builder.Append(" severity: "); + builder.AppendLine($"'{Severity.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Description), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" description: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Description)) + { + builder.Append(" description: "); + if (Description.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Description}'''"); + } + else + { + builder.AppendLine($"'{Description}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SuggestedResourceIds), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" suggestedResourceIds: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(SuggestedResourceIds)) + { + if (SuggestedResourceIds.Any()) + { + builder.Append(" suggestedResourceIds: "); + builder.AppendLine("["); + foreach (var item in SuggestedResourceIds) + { + if (item == null) + { + builder.Append("null"); + continue; + } + if (item.Contains(Environment.NewLine)) + { + builder.AppendLine(" '''"); + builder.AppendLine($"{item}'''"); + } + else + { + builder.AppendLine($" '{item}'"); + } + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SuggestedAccessRules), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" suggestedAccessRules: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(SuggestedAccessRules)) + { + if (SuggestedAccessRules.Any()) + { + builder.Append(" suggestedAccessRules: "); + builder.AppendLine("["); + foreach (var item in SuggestedAccessRules) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 6, true, " suggestedAccessRules: "); + } + 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; @@ -209,6 +364,8 @@ BinaryData IPersistableModel.Write(ModelReaderWr { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(HybridComputeProvisioningIssue)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeProvisioningIssue.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeProvisioningIssue.cs index c14ebaa953889..4bc079e4ea577 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeProvisioningIssue.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeProvisioningIssue.cs @@ -72,16 +72,22 @@ internal HybridComputeProvisioningIssue(string name, HybridComputeProvisioningIs } /// Name of the provisioning issue. + [WirePath("name")] public string Name { get; } /// Issue type. + [WirePath("properties.issueType")] public HybridComputeProvisioningIssueType? IssueType { get; } /// Severity of the provisioning issue. + [WirePath("properties.severity")] public HybridComputeProvisioningIssueSeverity? Severity { get; } /// Description of the provisioning issue. + [WirePath("properties.description")] public string Description { get; } /// ARM Ids of the resources that can be associated to the same perimeter to remediate the issue. + [WirePath("properties.suggestedResourceIds")] public IReadOnlyList SuggestedResourceIds { get; } /// Access rules that can be added to the perimeter to remediate the issue. + [WirePath("properties.suggestedAccessRules")] public IReadOnlyList SuggestedAccessRules { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeResourceAssociation.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeResourceAssociation.Serialization.cs index 4e9b656acb6ae..aa9c7c5192b93 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeResourceAssociation.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeResourceAssociation.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -103,6 +104,59 @@ internal static HybridComputeResourceAssociation DeserializeHybridComputeResourc return new HybridComputeResourceAssociation(name, accessMode, 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(AccessMode), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" accessMode: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AccessMode)) + { + builder.Append(" accessMode: "); + builder.AppendLine($"'{AccessMode.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -111,6 +165,8 @@ BinaryData IPersistableModel.Write(ModelReader { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(HybridComputeResourceAssociation)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeResourceAssociation.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeResourceAssociation.cs index 99d3df5f5bbf6..60c2b459dbc6c 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeResourceAssociation.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeResourceAssociation.cs @@ -62,8 +62,10 @@ internal HybridComputeResourceAssociation(string name, HybridComputeAccessMode? } /// Name of the Resource Association. + [WirePath("name")] public string Name { get; } /// The access mode. + [WirePath("accessMode")] public HybridComputeAccessMode? AccessMode { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeResourceUpdate.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeResourceUpdate.cs index 0e838d4eaa0e0..c890a1f912df8 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeResourceUpdate.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeResourceUpdate.cs @@ -61,6 +61,7 @@ internal HybridComputeResourceUpdate(IDictionary tags, IDictiona } /// Resource tags. + [WirePath("tags")] public IDictionary Tags { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeServiceStatus.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeServiceStatus.Serialization.cs index abf5330796ef5..475d871a5d7e3 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeServiceStatus.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeServiceStatus.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -99,6 +100,67 @@ internal static HybridComputeServiceStatus DeserializeHybridComputeServiceStatus return new HybridComputeServiceStatus(status, startupType, serializedAdditionalRawData); } + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Status), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" status: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Status)) + { + builder.Append(" status: "); + if (Status.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Status}'''"); + } + else + { + builder.AppendLine($"'{Status}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(StartupType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" startupType: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(StartupType)) + { + builder.Append(" startupType: "); + if (StartupType.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{StartupType}'''"); + } + else + { + builder.AppendLine($"'{StartupType}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -107,6 +169,8 @@ BinaryData IPersistableModel.Write(ModelReaderWriter { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(HybridComputeServiceStatus)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeServiceStatus.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeServiceStatus.cs index cf0c9f75e37bd..45aa47e133b2a 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeServiceStatus.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeServiceStatus.cs @@ -62,8 +62,10 @@ internal HybridComputeServiceStatus(string status, string startupType, IDictiona } /// The current status of the service. + [WirePath("status")] public string Status { get; set; } /// The behavior of the service when the Arc-enabled machine starts up. + [WirePath("startupType")] public string StartupType { get; set; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeServiceStatuses.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeServiceStatuses.Serialization.cs index 8d80210927ad2..bec649ac402ae 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeServiceStatuses.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeServiceStatuses.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -107,6 +108,51 @@ internal static HybridComputeServiceStatuses DeserializeHybridComputeServiceStat return new HybridComputeServiceStatuses(extensionService, guestConfigurationService, 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(ExtensionService), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" extensionService: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ExtensionService)) + { + builder.Append(" extensionService: "); + BicepSerializationHelpers.AppendChildObject(builder, ExtensionService, options, 2, false, " extensionService: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(GuestConfigurationService), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" guestConfigurationService: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(GuestConfigurationService)) + { + builder.Append(" guestConfigurationService: "); + BicepSerializationHelpers.AppendChildObject(builder, GuestConfigurationService, options, 2, false, " guestConfigurationService: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -115,6 +161,8 @@ BinaryData IPersistableModel.Write(ModelReaderWrit { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(HybridComputeServiceStatuses)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeServiceStatuses.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeServiceStatuses.cs index c8c87ad25c2bd..4f293376312f4 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeServiceStatuses.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeServiceStatuses.cs @@ -62,8 +62,10 @@ internal HybridComputeServiceStatuses(HybridComputeServiceStatus extensionServic } /// The state of the extension service on the Arc-enabled machine. + [WirePath("extensionService")] public HybridComputeServiceStatus ExtensionService { get; set; } /// The state of the guest configuration service on the Arc-enabled machine. + [WirePath("guestConfigurationService")] public HybridComputeServiceStatus GuestConfigurationService { get; set; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeSubnet.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeSubnet.Serialization.cs index 257ede866f1cd..77e1169e399b6 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeSubnet.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeSubnet.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -88,6 +89,44 @@ internal static HybridComputeSubnet DeserializeHybridComputeSubnet(JsonElement e return new HybridComputeSubnet(addressPrefix, 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(AddressPrefix), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" addressPrefix: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AddressPrefix)) + { + builder.Append(" addressPrefix: "); + if (AddressPrefix.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{AddressPrefix}'''"); + } + else + { + builder.AppendLine($"'{AddressPrefix}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -96,6 +135,8 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(HybridComputeSubnet)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeSubnet.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeSubnet.cs index accf495ba3a53..b988251187c60 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeSubnet.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeSubnet.cs @@ -60,6 +60,7 @@ internal HybridComputeSubnet(string addressPrefix, IDictionary Represents address prefix. + [WirePath("addressPrefix")] public string AddressPrefix { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/Settings.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeTargetResourceSettings.Serialization.cs similarity index 54% rename from sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/Settings.Serialization.cs rename to sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeTargetResourceSettings.Serialization.cs index 64a4d551cc844..a72546c7483bb 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/Settings.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeTargetResourceSettings.Serialization.cs @@ -8,22 +8,23 @@ 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 Settings : IUtf8JsonSerializable, IJsonModel + public partial class HybridComputeTargetResourceSettings : IUtf8JsonSerializable, IJsonModel { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(Settings)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(HybridComputeTargetResourceSettings)} does not support writing '{format}' format."); } writer.WriteStartObject(); @@ -81,19 +82,19 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions writer.WriteEndObject(); } - Settings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + HybridComputeTargetResourceSettings 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(Settings)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(HybridComputeTargetResourceSettings)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeSettings(document.RootElement, options); + return DeserializeHybridComputeTargetResourceSettings(document.RootElement, options); } - internal static Settings DeserializeSettings(JsonElement element, ModelReaderWriterOptions options = null) + internal static HybridComputeTargetResourceSettings DeserializeHybridComputeTargetResourceSettings(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -183,7 +184,7 @@ internal static Settings DeserializeSettings(JsonElement element, ModelReaderWri } } serializedAdditionalRawData = rawDataDictionary; - return new Settings( + return new HybridComputeTargetResourceSettings( id, name, type, @@ -193,35 +194,141 @@ internal static Settings DeserializeSettings(JsonElement element, ModelReaderWri serializedAdditionalRawData); } - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + private BinaryData SerializeBicep(ModelReaderWriterOptions options) { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + 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(Settings)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(HybridComputeTargetResourceSettings)} does not support writing '{options.Format}' format."); } } - Settings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + HybridComputeTargetResourceSettings 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 DeserializeSettings(document.RootElement, options); + return DeserializeHybridComputeTargetResourceSettings(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(Settings)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(HybridComputeTargetResourceSettings)} 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/Settings.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeTargetResourceSettings.cs similarity index 76% rename from sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/Settings.cs rename to sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeTargetResourceSettings.cs index b43d85e63eff0..d0cbb1bbf41c0 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/Settings.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeTargetResourceSettings.cs @@ -12,8 +12,8 @@ namespace Azure.ResourceManager.HybridCompute.Models { - /// The Settings. - public partial class Settings : ResourceData + /// The HybridComputeTargetResourceSettings. + public partial class HybridComputeTargetResourceSettings : ResourceData { /// /// Keeps track of any properties unknown to the library. @@ -47,12 +47,12 @@ public partial class Settings : ResourceData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public Settings() + /// Initializes a new instance of . + public HybridComputeTargetResourceSettings() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -60,7 +60,7 @@ public Settings() /// Azure resource tenant Id. /// Associated Gateway Resource Id. /// Keeps track of any properties unknown to the library. - internal Settings(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, Guid? tenantId, ResourceIdentifier gatewayResourceId, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + 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; @@ -68,8 +68,10 @@ internal Settings(ResourceIdentifier id, string name, ResourceType resourceType, } /// 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/HybridComputeWindowsConfiguration.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeWindowsConfiguration.Serialization.cs index bbdc9e659c4db..217e9f992955f 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeWindowsConfiguration.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeWindowsConfiguration.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -38,10 +39,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WritePropertyName("patchMode"u8); writer.WriteStringValue(PatchMode.Value.ToString()); } - if (Optional.IsDefined(EnableHotpatching)) + if (Optional.IsDefined(IsHotpatchingEnabled)) { writer.WritePropertyName("enableHotpatching"u8); - writer.WriteBooleanValue(EnableHotpatching.Value); + writer.WriteBooleanValue(IsHotpatchingEnabled.Value); } if (options.Format != "W" && Optional.IsDefined(Status)) { @@ -90,7 +91,7 @@ internal static HybridComputeWindowsConfiguration DeserializeHybridComputeWindow AssessmentModeType? assessmentMode = default; PatchModeType? patchMode = default; bool? enableHotpatching = default; - PatchSettingsStatus status = default; + HybridComputePatchSettingsStatus status = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -137,7 +138,7 @@ internal static HybridComputeWindowsConfiguration DeserializeHybridComputeWindow { continue; } - status = PatchSettingsStatus.DeserializePatchSettingsStatus(property0.Value, options); + status = HybridComputePatchSettingsStatus.DeserializeHybridComputePatchSettingsStatus(property0.Value, options); continue; } } @@ -152,6 +153,85 @@ internal static HybridComputeWindowsConfiguration DeserializeHybridComputeWindow return new HybridComputeWindowsConfiguration(assessmentMode, patchMode, enableHotpatching, status, serializedAdditionalRawData); } + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + builder.Append(" patchSettings:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AssessmentMode), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" assessmentMode: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AssessmentMode)) + { + builder.Append(" assessmentMode: "); + builder.AppendLine($"'{AssessmentMode.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PatchMode), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" patchMode: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PatchMode)) + { + builder.Append(" patchMode: "); + builder.AppendLine($"'{PatchMode.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsHotpatchingEnabled), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" enableHotpatching: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IsHotpatchingEnabled)) + { + builder.Append(" enableHotpatching: "); + var boolValue = IsHotpatchingEnabled.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Status), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" status: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Status)) + { + builder.Append(" status: "); + BicepSerializationHelpers.AppendChildObject(builder, Status, options, 4, false, " status: "); + } + } + + 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; @@ -160,6 +240,8 @@ BinaryData IPersistableModel.Write(ModelReade { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(HybridComputeWindowsConfiguration)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeWindowsConfiguration.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeWindowsConfiguration.cs index 6b8f548fdd88d..034883506fb4d 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeWindowsConfiguration.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeWindowsConfiguration.cs @@ -53,25 +53,29 @@ public HybridComputeWindowsConfiguration() /// 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. + /// 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. /// Keeps track of any properties unknown to the library. - internal HybridComputeWindowsConfiguration(AssessmentModeType? assessmentMode, PatchModeType? patchMode, bool? enableHotpatching, PatchSettingsStatus status, IDictionary serializedAdditionalRawData) + internal HybridComputeWindowsConfiguration(AssessmentModeType? assessmentMode, PatchModeType? patchMode, bool? isHotpatchingEnabled, HybridComputePatchSettingsStatus status, IDictionary serializedAdditionalRawData) { AssessmentMode = assessmentMode; PatchMode = patchMode; - EnableHotpatching = enableHotpatching; + IsHotpatchingEnabled = isHotpatchingEnabled; Status = status; _serializedAdditionalRawData = serializedAdditionalRawData; } /// Specifies the assessment mode. + [WirePath("patchSettings.assessmentMode")] public AssessmentModeType? AssessmentMode { get; set; } /// Specifies the patch mode. + [WirePath("patchSettings.patchMode")] public PatchModeType? PatchMode { get; set; } /// Captures the hotpatch capability enrollment intent of the customers, which enables customers to patch their Windows machines without requiring a reboot. - public bool? EnableHotpatching { get; set; } + [WirePath("patchSettings.enableHotpatching")] + public bool? IsHotpatchingEnabled { get; set; } /// Status of the hotpatch capability enrollment or disenrollment. - public PatchSettingsStatus Status { get; } + [WirePath("patchSettings.status")] + public HybridComputePatchSettingsStatus Status { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeWindowsParameters.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeWindowsParameters.cs index def6fdc27320b..db2f10995d707 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeWindowsParameters.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeWindowsParameters.cs @@ -71,14 +71,19 @@ internal HybridComputeWindowsParameters(IList } /// The update classifications to select when installing patches for Windows. + [WirePath("classificationsToInclude")] public IList ClassificationsToInclude { get; } /// Kbs to include in the patch operation. + [WirePath("kbNumbersToInclude")] public IList KbNumbersToInclude { get; } /// Kbs to exclude in the patch operation. + [WirePath("kbNumbersToExclude")] public IList KbNumbersToExclude { get; } /// Filters out Kbs that don't have an InstallationRebootBehavior of 'NeverReboots' when this is set to true. + [WirePath("excludeKbsRequiringReboot")] public bool? ExcludeKbsRequiringReboot { get; set; } /// This is used to install patches that were published on or before this given max published date. + [WirePath("maxPatchPublishDate")] public DateTimeOffset? MaxPatchPublishOn { get; set; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileArmEsuPropertiesWithoutAssignedLicense.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileArmEsuPropertiesWithoutAssignedLicense.Serialization.cs index eade8279a5152..10efb8f277f59 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileArmEsuPropertiesWithoutAssignedLicense.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileArmEsuPropertiesWithoutAssignedLicense.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; @@ -168,6 +170,104 @@ internal static LicenseProfileArmEsuPropertiesWithoutAssignedLicense Deserialize esuKeyState); } + 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(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(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, 4, true, " esuKeys: "); + } + 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; @@ -176,6 +276,8 @@ BinaryData IPersistableModel The type of the Esu servers. + [WirePath("serverType")] public EsuServerType? ServerType { get; } /// Indicates the eligibility state of Esu. + [WirePath("esuEligibility")] public EsuEligibility? EsuEligibility { get; } /// Indicates whether there is an ESU Key currently active for the machine. + [WirePath("esuKeyState")] public EsuKeyState? EsuKeyState { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileMachineInstanceView.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileMachineInstanceView.Serialization.cs index 89240515556b3..10b91a48ed935 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileMachineInstanceView.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileMachineInstanceView.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; @@ -306,6 +308,228 @@ internal static LicenseProfileMachineInstanceView DeserializeLicenseProfileMachi 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(LicenseStatus), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" licenseStatus: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LicenseStatus)) + { + builder.Append(" licenseStatus: "); + builder.AppendLine($"'{LicenseStatus.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LicenseChannel), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" licenseChannel: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LicenseChannel)) + { + builder.Append(" licenseChannel: "); + if (LicenseChannel.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{LicenseChannel}'''"); + } + else + { + builder.AppendLine($"'{LicenseChannel}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EsuProfile), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" esuProfile: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(EsuProfile)) + { + builder.Append(" esuProfile: "); + BicepSerializationHelpers.AppendChildObject(builder, EsuProfile, options, 2, false, " esuProfile: "); + } + } + + 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, 4, 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, 6, true, " productFeatures: "); + } + builder.AppendLine(" ]"); + } + } + } + + builder.AppendLine(" }"); + builder.Append(" softwareAssurance:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsSoftwareAssuranceCustomer), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" softwareAssuranceCustomer: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IsSoftwareAssuranceCustomer)) + { + builder.Append(" softwareAssuranceCustomer: "); + var boolValue = IsSoftwareAssuranceCustomer.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + 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; @@ -314,6 +538,8 @@ BinaryData IPersistableModel.Write(ModelReade { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(LicenseProfileMachineInstanceView)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileMachineInstanceView.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileMachineInstanceView.cs index ded4ae467e2bb..9e26346bd0537 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileMachineInstanceView.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileMachineInstanceView.cs @@ -83,28 +83,40 @@ internal LicenseProfileMachineInstanceView(HybridComputeLicenseStatus? licenseSt } /// Indicates the license status of the OS. + [WirePath("licenseStatus")] public HybridComputeLicenseStatus? LicenseStatus { get; } /// Indicates the license channel. + [WirePath("licenseChannel")] public string LicenseChannel { get; } /// Properties for the Machine ESU profile. + [WirePath("esuProfile")] public LicenseProfileMachineInstanceViewEsuProperties EsuProfile { get; set; } /// Indicates the subscription status of the product. + [WirePath("productProfile.subscriptionStatus")] public LicenseProfileSubscriptionStatus? SubscriptionStatus { get; set; } /// Indicates the product type of the license. + [WirePath("productProfile.productType")] public LicenseProfileProductType? ProductType { get; set; } /// The timestamp in UTC when the user enrolls the feature. + [WirePath("productProfile.enrollmentDate")] public DateTimeOffset? EnrollmentOn { get; } /// The timestamp in UTC when the billing starts. + [WirePath("productProfile.billingStartDate")] public DateTimeOffset? BillingStartOn { get; } /// The timestamp in UTC when the user disenrolled the feature. + [WirePath("productProfile.disenrollmentDate")] public DateTimeOffset? DisenrollmentOn { get; } /// The timestamp in UTC when the billing ends. + [WirePath("productProfile.billingEndDate")] public DateTimeOffset? BillingEndOn { get; } /// The errors that were encountered during the feature enrollment or disenrollment. + [WirePath("productProfile.error")] public ResponseError Error { get; } /// The list of product features. + [WirePath("productProfile.productFeatures")] public IList ProductFeatures { get; } /// Specifies if this machine is licensed as part of a Software Assurance agreement. + [WirePath("softwareAssurance.softwareAssuranceCustomer")] public bool? IsSoftwareAssuranceCustomer { get; set; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileMachineInstanceViewEsuProperties.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileMachineInstanceViewEsuProperties.Serialization.cs index 33a235259f387..b6013e3509253 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileMachineInstanceViewEsuProperties.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileMachineInstanceViewEsuProperties.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; @@ -200,6 +202,134 @@ internal static LicenseProfileMachineInstanceViewEsuProperties DeserializeLicens licenseAssignmentState); } + 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(AssignedLicense), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" assignedLicense: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AssignedLicense)) + { + builder.Append(" assignedLicense: "); + BicepSerializationHelpers.AppendChildObject(builder, AssignedLicense, options, 2, false, " assignedLicense: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LicenseAssignmentState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" licenseAssignmentState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LicenseAssignmentState)) + { + builder.Append(" licenseAssignmentState: "); + builder.AppendLine($"'{LicenseAssignmentState.Value.ToString()}'"); + } + } + + 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(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, 4, true, " esuKeys: "); + } + 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; @@ -208,6 +338,8 @@ BinaryData IPersistableModel.Wri { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(LicenseProfileMachineInstanceViewEsuProperties)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileMachineInstanceViewEsuProperties.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileMachineInstanceViewEsuProperties.cs index 251c3607f12e6..518796dfabd99 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileMachineInstanceViewEsuProperties.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileMachineInstanceViewEsuProperties.cs @@ -34,8 +34,10 @@ internal LicenseProfileMachineInstanceViewEsuProperties(Guid? assignedLicenseImm } /// The assigned license resource. + [WirePath("assignedLicense")] public HybridComputeLicenseData AssignedLicense { get; set; } /// Describes the license assignment state (Assigned or NotAssigned). + [WirePath("licenseAssignmentState")] public LicenseAssignmentState? LicenseAssignmentState { get; set; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileStorageModelEsuProperties.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileStorageModelEsuProperties.Serialization.cs index 2b963a5b5c798..1d57c5fbb4a97 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileStorageModelEsuProperties.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileStorageModelEsuProperties.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; @@ -117,6 +119,59 @@ internal static LicenseProfileStorageModelEsuProperties DeserializeLicenseProfil return new LicenseProfileStorageModelEsuProperties(assignedLicenseImmutableId, esuKeys ?? 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(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, 4, true, " esuKeys: "); + } + 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; @@ -125,6 +180,8 @@ BinaryData IPersistableModel.Write(Mode { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(LicenseProfileStorageModelEsuProperties)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileStorageModelEsuProperties.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileStorageModelEsuProperties.cs index aea1e876c5aed..3c2ddad37d10a 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileStorageModelEsuProperties.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicenseProfileStorageModelEsuProperties.cs @@ -63,8 +63,10 @@ internal LicenseProfileStorageModelEsuProperties(Guid? assignedLicenseImmutableI } /// The guid id of the license. + [WirePath("assignedLicenseImmutableId")] public Guid? AssignedLicenseImmutableId { get; } /// The list of ESU keys. + [WirePath("esuKeys")] public IReadOnlyList EsuKeys { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicensesListResult.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicensesListResult.Serialization.cs index e1baae8756700..8e90fed80b94b 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicensesListResult.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/LicensesListResult.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; @@ -106,6 +108,67 @@ internal static LicensesListResult DeserializeLicensesListResult(JsonElement ele return new LicensesListResult(value, 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; @@ -114,6 +177,8 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(LicensesListResult)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineAssessPatchesResult.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineAssessPatchesResult.Serialization.cs index a4d205278db65..eacd8f36d2495 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineAssessPatchesResult.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineAssessPatchesResult.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -238,6 +239,174 @@ internal static MachineAssessPatchesResult DeserializeMachineAssessPatchesResult serializedAdditionalRawData); } + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Status), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" status: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Status)) + { + builder.Append(" status: "); + builder.AppendLine($"'{Status.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AssessmentActivityId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" assessmentActivityId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AssessmentActivityId)) + { + builder.Append(" assessmentActivityId: "); + builder.AppendLine($"'{AssessmentActivityId.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IsRebootPending), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" rebootPending: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(IsRebootPending)) + { + builder.Append(" rebootPending: "); + var boolValue = IsRebootPending.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AvailablePatchCountByClassification), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" availablePatchCountByClassification: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AvailablePatchCountByClassification)) + { + builder.Append(" availablePatchCountByClassification: "); + BicepSerializationHelpers.AppendChildObject(builder, AvailablePatchCountByClassification, options, 2, false, " availablePatchCountByClassification: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(StartOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" startDateTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(StartOn)) + { + builder.Append(" startDateTime: "); + var formattedDateTimeString = TypeFormatters.ToString(StartOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LastModifiedOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" lastModifiedDateTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LastModifiedOn)) + { + builder.Append(" lastModifiedDateTime: "); + var formattedDateTimeString = TypeFormatters.ToString(LastModifiedOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(StartedBy), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" startedBy: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(StartedBy)) + { + builder.Append(" startedBy: "); + builder.AppendLine($"'{StartedBy.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PatchServiceUsed), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" patchServiceUsed: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PatchServiceUsed)) + { + builder.Append(" patchServiceUsed: "); + builder.AppendLine($"'{PatchServiceUsed.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OSType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" osType: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(OSType)) + { + builder.Append(" osType: "); + builder.AppendLine($"'{OSType.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ErrorDetails), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" errorDetails: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ErrorDetails)) + { + builder.Append(" errorDetails: "); + BicepSerializationHelpers.AppendChildObject(builder, ErrorDetails, options, 2, false, " errorDetails: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -246,6 +415,8 @@ BinaryData IPersistableModel.Write(ModelReaderWriter { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(MachineAssessPatchesResult)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineAssessPatchesResult.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineAssessPatchesResult.cs index c7f5fff940169..076da06a5d7b2 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineAssessPatchesResult.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineAssessPatchesResult.cs @@ -78,24 +78,34 @@ internal MachineAssessPatchesResult(MachineOperationStatus? status, Guid? assess } /// 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.". + [WirePath("status")] public MachineOperationStatus? Status { get; } /// The activity ID of the operation that produced this result. + [WirePath("assessmentActivityId")] public Guid? AssessmentActivityId { get; } /// The overall reboot status of the VM. It will be true when partially installed patches require a reboot to complete installation but the reboot has not yet occurred. + [WirePath("rebootPending")] public bool? IsRebootPending { get; } /// Summarization of patches available for installation on the machine by classification. + [WirePath("availablePatchCountByClassification")] public AvailablePatchCountByClassification AvailablePatchCountByClassification { get; } /// The UTC timestamp when the operation began. + [WirePath("startDateTime")] public DateTimeOffset? StartOn { get; } /// The UTC timestamp when the operation finished. + [WirePath("lastModifiedDateTime")] public DateTimeOffset? LastModifiedOn { get; } /// Indicates if operation was triggered by user or by platform. + [WirePath("startedBy")] public PatchOperationStartedBy? StartedBy { get; } /// Specifies the patch service used for the operation. + [WirePath("patchServiceUsed")] public PatchServiceUsed? PatchServiceUsed { get; } /// The operating system type of the machine. + [WirePath("osType")] public HybridComputeOSType? OSType { get; } /// The errors that were encountered during execution of the operation. The details array contains the list of them. + [WirePath("errorDetails")] public ResponseError ErrorDetails { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionInstanceView.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionInstanceView.Serialization.cs index 8a98a2499d1c9..c2e9eda4b2796 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionInstanceView.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionInstanceView.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -125,6 +126,105 @@ internal static MachineExtensionInstanceView DeserializeMachineExtensionInstance return new MachineExtensionInstanceView(name, type, typeHandlerVersion, status, serializedAdditionalRawData); } + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(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(MachineExtensionInstanceViewType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" type: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MachineExtensionInstanceViewType)) + { + builder.Append(" type: "); + if (MachineExtensionInstanceViewType.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{MachineExtensionInstanceViewType}'''"); + } + else + { + builder.AppendLine($"'{MachineExtensionInstanceViewType}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TypeHandlerVersion), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" typeHandlerVersion: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TypeHandlerVersion)) + { + builder.Append(" typeHandlerVersion: "); + if (TypeHandlerVersion.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{TypeHandlerVersion}'''"); + } + else + { + builder.AppendLine($"'{TypeHandlerVersion}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Status), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" status: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Status)) + { + builder.Append(" status: "); + BicepSerializationHelpers.AppendChildObject(builder, Status, options, 2, false, " status: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -133,6 +233,8 @@ BinaryData IPersistableModel.Write(ModelReaderWrit { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(MachineExtensionInstanceView)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionInstanceView.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionInstanceView.cs index 6962fd17e736b..463a5eda00484 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionInstanceView.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionInstanceView.cs @@ -66,12 +66,16 @@ internal MachineExtensionInstanceView(string name, string machineExtensionInstan } /// The machine extension name. + [WirePath("name")] public string Name { get; set; } /// Specifies the type of the extension; an example is "CustomScriptExtension". + [WirePath("type")] public string MachineExtensionInstanceViewType { get; set; } /// Specifies the version of the script handler. + [WirePath("typeHandlerVersion")] public string TypeHandlerVersion { get; set; } /// Instance view status. + [WirePath("status")] public MachineExtensionInstanceViewStatus Status { get; set; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionInstanceViewStatus.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionInstanceViewStatus.Serialization.cs index bca03cf4ea6f5..906cae44cdba2 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionInstanceViewStatus.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionInstanceViewStatus.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -146,6 +147,121 @@ internal static MachineExtensionInstanceViewStatus DeserializeMachineExtensionIn 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.ToString()}'"); + } + } + + 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; @@ -154,6 +270,8 @@ BinaryData IPersistableModel.Write(ModelRead { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(MachineExtensionInstanceViewStatus)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionInstanceViewStatus.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionInstanceViewStatus.cs index 3704c4c56d3b6..26f9c2f64fdd1 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionInstanceViewStatus.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionInstanceViewStatus.cs @@ -68,14 +68,19 @@ internal MachineExtensionInstanceViewStatus(string code, HybridComputeStatusLeve } /// The status code. + [WirePath("code")] public string Code { get; set; } /// The level code. + [WirePath("level")] public HybridComputeStatusLevelType? Level { get; set; } /// The short localizable label for the status. + [WirePath("displayStatus")] public string DisplayStatus { get; set; } /// The detailed status message, including for alerts and error messages. + [WirePath("message")] public string Message { get; set; } /// The time of the status. + [WirePath("time")] public DateTimeOffset? Time { get; set; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionProperties.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionProperties.Serialization.cs index 1d743f1cc8de5..faf55fd469bc8 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionProperties.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionProperties.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; @@ -278,6 +280,241 @@ internal static MachineExtensionProperties DeserializeMachineExtensionProperties 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(ForceUpdateTag), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" forceUpdateTag: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ForceUpdateTag)) + { + builder.Append(" forceUpdateTag: "); + if (ForceUpdateTag.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ForceUpdateTag}'''"); + } + else + { + builder.AppendLine($"'{ForceUpdateTag}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Publisher), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" publisher: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Publisher)) + { + builder.Append(" publisher: "); + if (Publisher.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Publisher}'''"); + } + else + { + builder.AppendLine($"'{Publisher}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MachineExtensionPropertiesType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" type: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MachineExtensionPropertiesType)) + { + builder.Append(" type: "); + if (MachineExtensionPropertiesType.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{MachineExtensionPropertiesType}'''"); + } + else + { + builder.AppendLine($"'{MachineExtensionPropertiesType}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TypeHandlerVersion), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" typeHandlerVersion: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(TypeHandlerVersion)) + { + builder.Append(" typeHandlerVersion: "); + if (TypeHandlerVersion.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{TypeHandlerVersion}'''"); + } + else + { + builder.AppendLine($"'{TypeHandlerVersion}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnableAutomaticUpgrade), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" enableAutomaticUpgrade: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(EnableAutomaticUpgrade)) + { + builder.Append(" enableAutomaticUpgrade: "); + var boolValue = EnableAutomaticUpgrade.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AutoUpgradeMinorVersion), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" autoUpgradeMinorVersion: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AutoUpgradeMinorVersion)) + { + builder.Append(" autoUpgradeMinorVersion: "); + var boolValue = AutoUpgradeMinorVersion.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Settings), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" settings: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(Settings)) + { + if (Settings.Any()) + { + builder.Append(" settings: "); + builder.AppendLine("{"); + foreach (var item in Settings) + { + builder.Append($" '{item.Key}': "); + if (item.Value == null) + { + builder.Append("null"); + continue; + } + builder.AppendLine($"'{item.Value.ToString()}'"); + } + builder.AppendLine(" }"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProtectedSettings), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" protectedSettings: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(ProtectedSettings)) + { + if (ProtectedSettings.Any()) + { + builder.Append(" protectedSettings: "); + builder.AppendLine("{"); + foreach (var item in ProtectedSettings) + { + builder.Append($" '{item.Key}': "); + if (item.Value == null) + { + builder.Append("null"); + continue; + } + builder.AppendLine($"'{item.Value.ToString()}'"); + } + builder.AppendLine(" }"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + 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, 2, false, " instanceView: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -286,6 +523,8 @@ BinaryData IPersistableModel.Write(ModelReaderWriter { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(MachineExtensionProperties)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionProperties.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionProperties.cs index 9970d3e53359e..386969080b6af 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionProperties.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionProperties.cs @@ -80,16 +80,22 @@ internal MachineExtensionProperties(string forceUpdateTag, string publisher, str } /// How the extension handler should be forced to update even if the extension configuration has not changed. + [WirePath("forceUpdateTag")] public string ForceUpdateTag { get; set; } /// The name of the extension handler publisher. + [WirePath("publisher")] public string Publisher { get; set; } /// Specifies the type of the extension; an example is "CustomScriptExtension". + [WirePath("type")] public string MachineExtensionPropertiesType { get; set; } /// Specifies the version of the script handler. + [WirePath("typeHandlerVersion")] public string TypeHandlerVersion { get; set; } /// Indicates whether the extension should be automatically upgraded by the platform if there is a newer version available. + [WirePath("enableAutomaticUpgrade")] public bool? EnableAutomaticUpgrade { get; set; } /// Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. + [WirePath("autoUpgradeMinorVersion")] public bool? AutoUpgradeMinorVersion { get; set; } /// /// Json formatted public settings for the extension. @@ -121,6 +127,7 @@ internal MachineExtensionProperties(string forceUpdateTag, string publisher, str /// /// /// + [WirePath("settings")] public IDictionary Settings { get; } /// /// The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. @@ -152,10 +159,13 @@ internal MachineExtensionProperties(string forceUpdateTag, string publisher, str /// /// /// + [WirePath("protectedSettings")] public IDictionary ProtectedSettings { get; } /// The provisioning state, which only appears in the response. + [WirePath("provisioningState")] public string ProvisioningState { get; } /// The machine extension instance view. + [WirePath("instanceView")] public MachineExtensionInstanceView InstanceView { get; set; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionUpgrade.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionUpgrade.cs index aeb5b2cfc0b54..18bbdc44adaca 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionUpgrade.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionUpgrade.cs @@ -61,6 +61,7 @@ internal MachineExtensionUpgrade(IDictionary } /// Describes the Extension Target Properties. + [WirePath("extensionTargets")] public IDictionary ExtensionTargets { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionsListResult.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionsListResult.Serialization.cs index 1a3c8bdd99743..4caea9d71d486 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionsListResult.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineExtensionsListResult.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; @@ -113,6 +115,67 @@ internal static MachineExtensionsListResult DeserializeMachineExtensionsListResu return new MachineExtensionsListResult(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; @@ -121,6 +184,8 @@ BinaryData IPersistableModel.Write(ModelReaderWrite { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(MachineExtensionsListResult)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineInstallPatchesContent.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineInstallPatchesContent.cs index 81a440bba6b18..4b25fff83c332 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineInstallPatchesContent.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineInstallPatchesContent.cs @@ -75,12 +75,16 @@ internal MachineInstallPatchesContent() } /// Specifies the maximum amount of time that the operation will run. It must be an ISO 8601-compliant duration string such as PT4H (4 hours). + [WirePath("maximumDuration")] public TimeSpan MaximumDuration { get; } /// Defines when it is acceptable to reboot a VM during a software update operation. + [WirePath("rebootSetting")] public VmGuestPatchRebootSetting RebootSetting { get; } /// Input for InstallPatches on a Windows VM, as directly received by the API. + [WirePath("windowsParameters")] public HybridComputeWindowsParameters WindowsParameters { get; set; } /// Input for InstallPatches on a Linux VM, as directly received by the API. + [WirePath("linuxParameters")] public HybridComputeLinuxParameters LinuxParameters { get; set; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineInstallPatchesResult.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineInstallPatchesResult.Serialization.cs index c7a5638d5e357..84a9a6f3f01df 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineInstallPatchesResult.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineInstallPatchesResult.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -314,6 +315,257 @@ internal static MachineInstallPatchesResult DeserializeMachineInstallPatchesResu serializedAdditionalRawData); } + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Status), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" status: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Status)) + { + builder.Append(" status: "); + builder.AppendLine($"'{Status.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(InstallationActivityId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" installationActivityId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(InstallationActivityId)) + { + builder.Append(" installationActivityId: "); + if (InstallationActivityId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{InstallationActivityId}'''"); + } + else + { + builder.AppendLine($"'{InstallationActivityId}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(RebootStatus), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" rebootStatus: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(RebootStatus)) + { + builder.Append(" rebootStatus: "); + builder.AppendLine($"'{RebootStatus.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(MaintenanceWindowExceeded), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" maintenanceWindowExceeded: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(MaintenanceWindowExceeded)) + { + builder.Append(" maintenanceWindowExceeded: "); + var boolValue = MaintenanceWindowExceeded.Value == true ? "true" : "false"; + builder.AppendLine($"{boolValue}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ExcludedPatchCount), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" excludedPatchCount: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ExcludedPatchCount)) + { + builder.Append(" excludedPatchCount: "); + builder.AppendLine($"{ExcludedPatchCount.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NotSelectedPatchCount), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" notSelectedPatchCount: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NotSelectedPatchCount)) + { + builder.Append(" notSelectedPatchCount: "); + builder.AppendLine($"{NotSelectedPatchCount.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PendingPatchCount), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" pendingPatchCount: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PendingPatchCount)) + { + builder.Append(" pendingPatchCount: "); + builder.AppendLine($"{PendingPatchCount.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(InstalledPatchCount), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" installedPatchCount: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(InstalledPatchCount)) + { + builder.Append(" installedPatchCount: "); + builder.AppendLine($"{InstalledPatchCount.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(FailedPatchCount), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" failedPatchCount: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(FailedPatchCount)) + { + builder.Append(" failedPatchCount: "); + builder.AppendLine($"{FailedPatchCount.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(StartOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" startDateTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(StartOn)) + { + builder.Append(" startDateTime: "); + var formattedDateTimeString = TypeFormatters.ToString(StartOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(LastModifiedOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" lastModifiedDateTime: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(LastModifiedOn)) + { + builder.Append(" lastModifiedDateTime: "); + var formattedDateTimeString = TypeFormatters.ToString(LastModifiedOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(StartedBy), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" startedBy: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(StartedBy)) + { + builder.Append(" startedBy: "); + builder.AppendLine($"'{StartedBy.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PatchServiceUsed), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" patchServiceUsed: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PatchServiceUsed)) + { + builder.Append(" patchServiceUsed: "); + builder.AppendLine($"'{PatchServiceUsed.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(OSType), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" osType: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(OSType)) + { + builder.Append(" osType: "); + builder.AppendLine($"'{OSType.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ErrorDetails), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" errorDetails: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ErrorDetails)) + { + builder.Append(" errorDetails: "); + BicepSerializationHelpers.AppendChildObject(builder, ErrorDetails, options, 2, false, " errorDetails: "); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -322,6 +574,8 @@ BinaryData IPersistableModel.Write(ModelReaderWrite { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(MachineInstallPatchesResult)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineInstallPatchesResult.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineInstallPatchesResult.cs index 9e103242d0625..93ea3cf210761 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineInstallPatchesResult.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineInstallPatchesResult.cs @@ -88,34 +88,49 @@ internal MachineInstallPatchesResult(MachineOperationStatus? status, string inst } /// The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At that point it will become "Failed", "Succeeded", "Unknown" or "CompletedWithWarnings.". + [WirePath("status")] public MachineOperationStatus? Status { get; } /// The activity ID of the operation that produced this result. + [WirePath("installationActivityId")] public string InstallationActivityId { get; } /// The reboot state of the VM following completion of the operation. + [WirePath("rebootStatus")] public VmGuestPatchRebootStatus? RebootStatus { get; } /// Whether the operation ran out of time before it completed all its intended actions. + [WirePath("maintenanceWindowExceeded")] public bool? MaintenanceWindowExceeded { get; } /// The number of patches that were not installed due to the user blocking their installation. + [WirePath("excludedPatchCount")] public int? ExcludedPatchCount { get; } /// The number of patches that were detected as available for install, but did not meet the operation's criteria. + [WirePath("notSelectedPatchCount")] public int? NotSelectedPatchCount { get; } /// The number of patches that were identified as meeting the installation criteria, but were not able to be installed. Typically this happens when maintenanceWindowExceeded == true. + [WirePath("pendingPatchCount")] public int? PendingPatchCount { get; } /// The number of patches successfully installed. + [WirePath("installedPatchCount")] public int? InstalledPatchCount { get; } /// The number of patches that could not be installed due to some issue. See errors for details. + [WirePath("failedPatchCount")] public int? FailedPatchCount { get; } /// The UTC timestamp when the operation began. + [WirePath("startDateTime")] public DateTimeOffset? StartOn { get; } /// The UTC timestamp when the operation finished. + [WirePath("lastModifiedDateTime")] public DateTimeOffset? LastModifiedOn { get; } /// Indicates if operation was triggered by user or by platform. + [WirePath("startedBy")] public PatchOperationStartedBy? StartedBy { get; } /// Specifies the patch service used for the operation. + [WirePath("patchServiceUsed")] public PatchServiceUsed? PatchServiceUsed { get; } /// The operating system type of the machine. + [WirePath("osType")] public HybridComputeOSType? OSType { get; } /// The errors that were encountered during execution of the operation. The details array contains the list of them. + [WirePath("errorDetails")] public ResponseError ErrorDetails { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineListResult.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineListResult.Serialization.cs index c586f19745a40..5d6b793b0dc5d 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineListResult.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineListResult.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; @@ -106,6 +108,67 @@ internal static MachineListResult DeserializeMachineListResult(JsonElement eleme return new MachineListResult(value, 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; @@ -114,6 +177,8 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOptions o { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(MachineListResult)} does not support writing '{options.Format}' format."); } 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 index 1140d85dcced6..377c9a8781715 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandInstanceView.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandInstanceView.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; @@ -204,6 +206,175 @@ internal static MachineRunCommandInstanceView DeserializeMachineRunCommandInstan 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; @@ -212,6 +383,8 @@ BinaryData IPersistableModel.Write(ModelReaderWri { 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."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandInstanceView.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandInstanceView.cs index 1df7bdc4569b5..7d4e909db720b 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandInstanceView.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandInstanceView.cs @@ -75,20 +75,28 @@ internal MachineRunCommandInstanceView(HybridComputeExecutionState? executionSta } /// 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 index 37b1f7078df0f..104c559c665b7 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandScriptSource.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandScriptSource.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -129,6 +130,97 @@ internal static MachineRunCommandScriptSource DeserializeMachineRunCommandScript 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; @@ -137,6 +229,8 @@ BinaryData IPersistableModel.Write(ModelReaderWri { 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."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandScriptSource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandScriptSource.cs index c429b1afe4608..2e5fc9bf1ee37 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandScriptSource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandScriptSource.cs @@ -66,12 +66,16 @@ internal MachineRunCommandScriptSource(string script, Uri scriptUri, string comm } /// 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 index 3adaf2e616ef9..b78e09453f047 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandsListResult.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/MachineRunCommandsListResult.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; @@ -113,6 +115,67 @@ internal static MachineRunCommandsListResult DeserializeMachineRunCommandsListRe 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; @@ -121,6 +184,8 @@ BinaryData IPersistableModel.Write(ModelReaderWrit { 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."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/NetworkSecurityPerimeter.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/NetworkSecurityPerimeter.Serialization.cs index 37d625a2950fa..3ec6230e5ab59 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/NetworkSecurityPerimeter.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/NetworkSecurityPerimeter.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -114,6 +115,82 @@ internal static NetworkSecurityPerimeter DeserializeNetworkSecurityPerimeter(Jso return new NetworkSecurityPerimeter(id, perimeterGuid, location, serializedAdditionalRawData); } + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + if (Id.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Id}'''"); + } + else + { + builder.AppendLine($"'{Id}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(PerimeterGuid), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" perimeterGuid: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PerimeterGuid)) + { + builder.Append(" perimeterGuid: "); + if (PerimeterGuid.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{PerimeterGuid}'''"); + } + else + { + builder.AppendLine($"'{PerimeterGuid}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Location), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" location: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Location)) + { + builder.Append(" location: "); + builder.AppendLine($"'{Location.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -122,6 +199,8 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOp { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(NetworkSecurityPerimeter)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/NetworkSecurityPerimeter.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/NetworkSecurityPerimeter.cs index 636baa09bb137..9ecbdfe9274a8 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/NetworkSecurityPerimeter.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/NetworkSecurityPerimeter.cs @@ -65,10 +65,13 @@ internal NetworkSecurityPerimeter(string id, string perimeterGuid, AzureLocation } /// Azure resource Id. + [WirePath("id")] public string Id { get; } /// Guid of the Network Security Perimeter. + [WirePath("perimeterGuid")] public string PerimeterGuid { get; } /// Regional location of the perimeter. + [WirePath("location")] public AzureLocation? Location { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/NetworkSecurityPerimeterConfigurationListResult.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/NetworkSecurityPerimeterConfigurationListResult.Serialization.cs index ee91e881d15c0..f98253786b1cb 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/NetworkSecurityPerimeterConfigurationListResult.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/NetworkSecurityPerimeterConfigurationListResult.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; @@ -113,6 +115,67 @@ internal static NetworkSecurityPerimeterConfigurationListResult DeserializeNetwo return new NetworkSecurityPerimeterConfigurationListResult(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; @@ -121,6 +184,8 @@ BinaryData IPersistableModel.Wr { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationListResult)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/NetworkSecurityPerimeterProfile.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/NetworkSecurityPerimeterProfile.Serialization.cs index e50267def9619..ffc26591b60e0 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/NetworkSecurityPerimeterProfile.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/NetworkSecurityPerimeterProfile.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; @@ -174,6 +176,133 @@ internal static NetworkSecurityPerimeterProfile DeserializeNetworkSecurityPerime 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(AccessRulesVersion), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" accessRulesVersion: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(AccessRulesVersion)) + { + builder.Append(" accessRulesVersion: "); + builder.AppendLine($"{AccessRulesVersion.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(AccessRules), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" accessRules: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(AccessRules)) + { + if (AccessRules.Any()) + { + builder.Append(" accessRules: "); + builder.AppendLine("["); + foreach (var item in AccessRules) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " accessRules: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(DiagnosticSettingsVersion), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" diagnosticSettingsVersion: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(DiagnosticSettingsVersion)) + { + builder.Append(" diagnosticSettingsVersion: "); + builder.AppendLine($"{DiagnosticSettingsVersion.Value}"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(EnabledLogCategories), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" enabledLogCategories: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(EnabledLogCategories)) + { + if (EnabledLogCategories.Any()) + { + builder.Append(" enabledLogCategories: "); + builder.AppendLine("["); + foreach (var item in EnabledLogCategories) + { + 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("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -182,6 +311,8 @@ BinaryData IPersistableModel.Write(ModelReaderW { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(NetworkSecurityPerimeterProfile)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/NetworkSecurityPerimeterProfile.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/NetworkSecurityPerimeterProfile.cs index 7a7dad5b14cb4..afdfbf86c6356 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/NetworkSecurityPerimeterProfile.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/NetworkSecurityPerimeterProfile.cs @@ -70,14 +70,19 @@ internal NetworkSecurityPerimeterProfile(string name, int? accessRulesVersion, I } /// Name of the resource. + [WirePath("name")] public string Name { get; } /// Access rules version number. + [WirePath("accessRulesVersion")] public int? AccessRulesVersion { get; } /// Collection of access rules for the profile. + [WirePath("accessRules")] public IReadOnlyList AccessRules { get; } /// Diagnostic settings version number. + [WirePath("diagnosticSettingsVersion")] public int? DiagnosticSettingsVersion { get; } /// Collection of enabled log categories for the profile. + [WirePath("enabledLogCategories")] public IReadOnlyList EnabledLogCategories { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PatchSettingsStatus.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PatchSettingsStatus.Serialization.cs deleted file mode 100644 index 32016a8a77af9..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PatchSettingsStatus.Serialization.cs +++ /dev/null @@ -1,141 +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 PatchSettingsStatus : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PatchSettingsStatus)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsDefined(HotpatchEnablementStatus)) - { - writer.WritePropertyName("hotpatchEnablementStatus"u8); - writer.WriteStringValue(HotpatchEnablementStatus.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(Error)) - { - writer.WritePropertyName("error"u8); - JsonSerializer.Serialize(writer, Error); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - PatchSettingsStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(PatchSettingsStatus)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializePatchSettingsStatus(document.RootElement, options); - } - - internal static PatchSettingsStatus DeserializePatchSettingsStatus(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - HotpatchEnablementStatus? hotpatchEnablementStatus = default; - ResponseError error = default; - IDictionary serializedAdditionalRawData = default; - Dictionary rawDataDictionary = new Dictionary(); - foreach (var property in element.EnumerateObject()) - { - if (property.NameEquals("hotpatchEnablementStatus"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - hotpatchEnablementStatus = new HotpatchEnablementStatus(property.Value.GetString()); - continue; - } - if (property.NameEquals("error"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - error = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new PatchSettingsStatus(hotpatchEnablementStatus, error, 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(PatchSettingsStatus)} does not support writing '{options.Format}' format."); - } - } - - PatchSettingsStatus 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 DeserializePatchSettingsStatus(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(PatchSettingsStatus)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PrivateEndpointConnectionDataModel.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PrivateEndpointConnectionDataModel.Serialization.cs index a5957c00cb45f..e7d774c86a5b5 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PrivateEndpointConnectionDataModel.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PrivateEndpointConnectionDataModel.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; using Azure.ResourceManager.Models; @@ -147,6 +148,89 @@ internal static PrivateEndpointConnectionDataModel DeserializePrivateEndpointCon 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(Properties), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" properties: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Properties)) + { + builder.Append(" properties: "); + BicepSerializationHelpers.AppendChildObject(builder, Properties, options, 2, false, " properties: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -155,6 +239,8 @@ BinaryData IPersistableModel.Write(ModelRead { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(PrivateEndpointConnectionDataModel)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PrivateEndpointConnectionDataModel.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PrivateEndpointConnectionDataModel.cs index aef19203946c6..85ba453fc2196 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PrivateEndpointConnectionDataModel.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PrivateEndpointConnectionDataModel.cs @@ -66,6 +66,7 @@ internal PrivateEndpointConnectionDataModel(ResourceIdentifier id, string name, } /// The Private Endpoint Connection properties. + [WirePath("properties")] public HybridComputePrivateEndpointConnectionProperties Properties { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PrivateLinkScopeValidationDetails.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PrivateLinkScopeValidationDetails.Serialization.cs index 632357a5b58f4..63e4bc6b694ca 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PrivateLinkScopeValidationDetails.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PrivateLinkScopeValidationDetails.Serialization.cs @@ -8,6 +8,8 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Linq; +using System.Text; using System.Text.Json; using Azure.Core; @@ -132,6 +134,74 @@ internal static PrivateLinkScopeValidationDetails DeserializePrivateLinkScopeVal return new PrivateLinkScopeValidationDetails(id, publicNetworkAccess, connectionDetails ?? 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(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(PublicNetworkAccess), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" publicNetworkAccess: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(PublicNetworkAccess)) + { + builder.Append(" publicNetworkAccess: "); + builder.AppendLine($"'{PublicNetworkAccess.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ConnectionDetails), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" connectionDetails: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(ConnectionDetails)) + { + if (ConnectionDetails.Any()) + { + builder.Append(" connectionDetails: "); + builder.AppendLine("["); + foreach (var item in ConnectionDetails) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 4, true, " connectionDetails: "); + } + 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; @@ -140,6 +210,8 @@ BinaryData IPersistableModel.Write(ModelReade { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(PrivateLinkScopeValidationDetails)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PrivateLinkScopeValidationDetails.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PrivateLinkScopeValidationDetails.cs index b02fe72283bca..7b1db693f3238 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PrivateLinkScopeValidationDetails.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/PrivateLinkScopeValidationDetails.cs @@ -66,10 +66,13 @@ internal PrivateLinkScopeValidationDetails(ResourceIdentifier id, HybridComputeP } /// Azure resource Id. + [WirePath("id")] public ResourceIdentifier Id { get; } /// Indicates whether machines associated with the private link scope can also use public Azure Arc service endpoints. + [WirePath("publicNetworkAccess")] public HybridComputePublicNetworkAccessType? PublicNetworkAccess { get; } /// List of Private Endpoint Connection details. + [WirePath("connectionDetails")] public IReadOnlyList ConnectionDetails { get; } } } 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 index 2d31d4b0d2a32..e252cbbca22d6 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandInputParameter.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandInputParameter.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -93,6 +94,67 @@ internal static RunCommandInputParameter DeserializeRunCommandInputParameter(Jso 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; @@ -101,6 +163,8 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOp { 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."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandInputParameter.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandInputParameter.cs index e998aa0af3782..055d761f88858 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandInputParameter.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandInputParameter.cs @@ -75,8 +75,10 @@ internal RunCommandInputParameter() } /// The run command parameter name. + [WirePath("name")] public string Name { get; set; } /// The run command parameter value. + [WirePath("value")] public string Value { get; set; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandManagedIdentity.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandManagedIdentity.Serialization.cs index 13c163d0d5fbe..7a7799dc03e70 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandManagedIdentity.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandManagedIdentity.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -107,6 +108,51 @@ internal static RunCommandManagedIdentity DeserializeRunCommandManagedIdentity(J return new RunCommandManagedIdentity(clientId, objectId, 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(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); + if (hasPropertyOverride) + { + builder.Append(" objectId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ObjectId)) + { + builder.Append(" objectId: "); + builder.AppendLine($"'{ObjectId.Value.ToString()}'"); + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -115,6 +161,8 @@ BinaryData IPersistableModel.Write(ModelReaderWriterO { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(RunCommandManagedIdentity)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandManagedIdentity.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandManagedIdentity.cs index 7a27ef53028d1..4bb36250f9c60 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandManagedIdentity.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/RunCommandManagedIdentity.cs @@ -62,8 +62,10 @@ internal RunCommandManagedIdentity(Guid? clientId, Guid? objectId, IDictionary 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/Models/VolumeLicenseDetails.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/VolumeLicenseDetails.Serialization.cs index 111cc9865cec4..66332be78880e 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/VolumeLicenseDetails.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/VolumeLicenseDetails.Serialization.cs @@ -8,6 +8,7 @@ using System; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Text; using System.Text.Json; using Azure.Core; @@ -103,6 +104,59 @@ internal static VolumeLicenseDetails DeserializeVolumeLicenseDetails(JsonElement return new VolumeLicenseDetails(programYear, invoiceId, 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(ProgramYear), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" programYear: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProgramYear)) + { + builder.Append(" programYear: "); + builder.AppendLine($"'{ProgramYear.Value.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(InvoiceId), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" invoiceId: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(InvoiceId)) + { + builder.Append(" invoiceId: "); + if (InvoiceId.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{InvoiceId}'''"); + } + else + { + builder.AppendLine($"'{InvoiceId}'"); + } + } + } + + builder.AppendLine("}"); + return BinaryData.FromString(builder.ToString()); + } + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; @@ -111,6 +165,8 @@ BinaryData IPersistableModel.Write(ModelReaderWriterOption { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(VolumeLicenseDetails)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/VolumeLicenseDetails.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/VolumeLicenseDetails.cs index 8462892f4cdf4..78514bbd99092 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/VolumeLicenseDetails.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/VolumeLicenseDetails.cs @@ -62,8 +62,10 @@ internal VolumeLicenseDetails(HybridComputeProgramYear? programYear, string invo } /// Describes the program year the volume license is for. + [WirePath("programYear")] public HybridComputeProgramYear? ProgramYear { get; set; } /// The invoice id for the volume license. + [WirePath("invoiceId")] public string InvoiceId { get; set; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/NetworkSecurityPerimeterConfigurationData.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/NetworkSecurityPerimeterConfigurationData.Serialization.cs index 461a0e1198135..429dcd86d739b 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/NetworkSecurityPerimeterConfigurationData.Serialization.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/NetworkSecurityPerimeterConfigurationData.Serialization.cs @@ -8,6 +8,8 @@ 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; @@ -233,6 +235,168 @@ internal static NetworkSecurityPerimeterConfigurationData DeserializeNetworkSecu serializedAdditionalRawData); } + private BinaryData SerializeBicep(ModelReaderWriterOptions options) + { + StringBuilder builder = new StringBuilder(); + BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions; + IDictionary propertyOverrides = null; + bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides); + bool hasPropertyOverride = false; + string propertyOverride = null; + + builder.AppendLine("{"); + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Name), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" name: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Name)) + { + builder.Append(" name: "); + if (Name.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Name}'''"); + } + else + { + builder.AppendLine($"'{Name}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Id), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" id: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Id)) + { + builder.Append(" id: "); + builder.AppendLine($"'{Id.ToString()}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(SystemData), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" systemData: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(SystemData)) + { + builder.Append(" systemData: "); + builder.AppendLine($"'{SystemData.ToString()}'"); + } + } + + builder.Append(" properties:"); + builder.AppendLine(" {"); + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningState), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningState: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ProvisioningState)) + { + builder.Append(" provisioningState: "); + if (ProvisioningState.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ProvisioningState}'''"); + } + else + { + builder.AppendLine($"'{ProvisioningState}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ProvisioningIssues), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" provisioningIssues: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsCollectionDefined(ProvisioningIssues)) + { + if (ProvisioningIssues.Any()) + { + builder.Append(" provisioningIssues: "); + builder.AppendLine("["); + foreach (var item in ProvisioningIssues) + { + BicepSerializationHelpers.AppendChildObject(builder, item, options, 6, true, " provisioningIssues: "); + } + builder.AppendLine(" ]"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(NetworkSecurityPerimeter), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" networkSecurityPerimeter: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(NetworkSecurityPerimeter)) + { + builder.Append(" networkSecurityPerimeter: "); + BicepSerializationHelpers.AppendChildObject(builder, NetworkSecurityPerimeter, options, 4, false, " networkSecurityPerimeter: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ResourceAssociation), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" resourceAssociation: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ResourceAssociation)) + { + builder.Append(" resourceAssociation: "); + BicepSerializationHelpers.AppendChildObject(builder, ResourceAssociation, options, 4, false, " resourceAssociation: "); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Profile), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" profile: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Profile)) + { + builder.Append(" profile: "); + BicepSerializationHelpers.AppendChildObject(builder, Profile, options, 4, false, " profile: "); + } + } + + 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; @@ -241,6 +405,8 @@ BinaryData IPersistableModel.Write(Mo { case "J": return ModelReaderWriter.Write(this, options); + case "bicep": + return SerializeBicep(options); default: throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationData)} does not support writing '{options.Format}' format."); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/NetworkSecurityPerimeterConfigurationData.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/NetworkSecurityPerimeterConfigurationData.cs index 1e2fad8775edb..5bc2ac2cf52c4 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/NetworkSecurityPerimeterConfigurationData.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/NetworkSecurityPerimeterConfigurationData.cs @@ -79,14 +79,19 @@ internal NetworkSecurityPerimeterConfigurationData(ResourceIdentifier id, string } /// Current state of this NetworkSecurityPerimeter: whether or not is has been provisioned within the resource group it is defined. Users cannot change this value but are able to read from it. Values will include Provisioning ,Succeeded, Canceled and Failed. + [WirePath("properties.provisioningState")] public string ProvisioningState { get; } /// Provisioning issues. + [WirePath("properties.provisioningIssues")] public IReadOnlyList ProvisioningIssues { get; } /// The Network Security Perimeter associated with this configuration. + [WirePath("properties.networkSecurityPerimeter")] public NetworkSecurityPerimeter NetworkSecurityPerimeter { get; } /// The Resource Association. + [WirePath("properties.resourceAssociation")] public HybridComputeResourceAssociation ResourceAssociation { get; } /// Network Security Perimeter profile. + [WirePath("properties.profile")] public NetworkSecurityPerimeterProfile Profile { get; } } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/GatewaysRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/GatewaysRestOperations.cs index 4331b0614cef2..4d34765a6e06a 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/GatewaysRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/GatewaysRestOperations.cs @@ -36,7 +36,7 @@ public GatewaysRestOperations(HttpPipeline pipeline, string applicationId, Uri e _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string gatewayName, GatewayData data) + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string gatewayName, HybridComputeGatewayData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -50,7 +50,7 @@ internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, return uri; } - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string gatewayName, GatewayData data) + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string gatewayName, HybridComputeGatewayData data) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -82,7 +82,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 gatewayName, GatewayData data, CancellationToken cancellationToken = default) + 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)); @@ -109,7 +109,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 gatewayName, GatewayData data, CancellationToken cancellationToken = default) + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string gatewayName, HybridComputeGatewayData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -128,7 +128,7 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string gatewayName, GatewayPatch patch) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string gatewayName, HybridComputeGatewayPatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -142,7 +142,7 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string gatewayName, GatewayPatch patch) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string gatewayName, HybridComputeGatewayPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -174,7 +174,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 gatewayName, GatewayPatch patch, CancellationToken cancellationToken = default) + 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)); @@ -187,9 +187,9 @@ public async Task> UpdateAsync(string subscriptionId, stri { case 200: { - GatewayData value = default; + HybridComputeGatewayData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = GatewayData.DeserializeGatewayData(document.RootElement); + value = HybridComputeGatewayData.DeserializeHybridComputeGatewayData(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -205,7 +205,7 @@ public async Task> UpdateAsync(string subscriptionId, stri /// 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, GatewayPatch patch, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string gatewayName, HybridComputeGatewayPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -218,9 +218,9 @@ public Response Update(string subscriptionId, string resourceGroupN { case 200: { - GatewayData value = default; + HybridComputeGatewayData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = GatewayData.DeserializeGatewayData(document.RootElement); + value = HybridComputeGatewayData.DeserializeHybridComputeGatewayData(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -269,7 +269,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 gatewayName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string gatewayName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -281,13 +281,13 @@ public async Task> GetAsync(string subscriptionId, string { case 200: { - GatewayData value = default; + HybridComputeGatewayData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = GatewayData.DeserializeGatewayData(document.RootElement); + value = HybridComputeGatewayData.DeserializeHybridComputeGatewayData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((GatewayData)null, message.Response); + return Response.FromValue((HybridComputeGatewayData)null, message.Response); default: throw new RequestFailedException(message.Response); } @@ -300,7 +300,7 @@ public async Task> GetAsync(string subscriptionId, string /// 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) + public Response Get(string subscriptionId, string resourceGroupName, string gatewayName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -312,13 +312,13 @@ public Response Get(string subscriptionId, string resourceGroupName { case 200: { - GatewayData value = default; + HybridComputeGatewayData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = GatewayData.DeserializeGatewayData(document.RootElement); + value = HybridComputeGatewayData.DeserializeHybridComputeGatewayData(document.RootElement); return Response.FromValue(value, message.Response); } case 404: - return Response.FromValue((GatewayData)null, message.Response); + return Response.FromValue((HybridComputeGatewayData)null, message.Response); default: throw new RequestFailedException(message.Response); } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/SettingsRestOperations.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/SettingsRestOperations.cs index a437cc66502c1..705e6da3d6914 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/SettingsRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/SettingsRestOperations.cs @@ -36,7 +36,7 @@ public SettingsRestOperations(HttpPipeline pipeline, string applicationId, Uri e _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, Settings settings) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, HybridComputeTargetResourceSettings hybridComputeTargetResourceSettings) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -56,7 +56,7 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string baseProvider, string baseResourceType, string baseResourceName, string settingsResourceName, Settings settings) + 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; @@ -80,7 +80,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(settings, ModelSerializationExtensions.WireOptions); + content.JsonWriter.WriteObjectValue(hybridComputeTargetResourceSettings, ModelSerializationExtensions.WireOptions); request.Content = content; _userAgent.Apply(message); return message; @@ -93,11 +93,11 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG /// The name of the base Resource Type. /// The name of the base resource. /// The name of the settings resource. - /// Settings details. + /// Settings details. /// The cancellation token to use. - /// , , , , , or is null. + /// , , , , , 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, Settings settings, CancellationToken cancellationToken = default) + 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)); @@ -105,18 +105,18 @@ public async Task> UpdateAsync(string subscriptionId, string Argument.AssertNotNullOrEmpty(baseResourceType, nameof(baseResourceType)); Argument.AssertNotNullOrEmpty(baseResourceName, nameof(baseResourceName)); Argument.AssertNotNullOrEmpty(settingsResourceName, nameof(settingsResourceName)); - Argument.AssertNotNull(settings, nameof(settings)); + Argument.AssertNotNull(hybridComputeTargetResourceSettings, nameof(hybridComputeTargetResourceSettings)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, baseProvider, baseResourceType, baseResourceName, settingsResourceName, settings); + 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: { - Settings value = default; + HybridComputeTargetResourceSettings value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = Settings.DeserializeSettings(document.RootElement); + value = HybridComputeTargetResourceSettings.DeserializeHybridComputeTargetResourceSettings(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -131,11 +131,11 @@ public async Task> UpdateAsync(string subscriptionId, string /// The name of the base Resource Type. /// The name of the base resource. /// The name of the settings resource. - /// Settings details. + /// Settings details. /// The cancellation token to use. - /// , , , , , or is null. + /// , , , , , 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, Settings settings, CancellationToken cancellationToken = default) + 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)); @@ -143,18 +143,18 @@ public Response Update(string subscriptionId, string resourceGroupName Argument.AssertNotNullOrEmpty(baseResourceType, nameof(baseResourceType)); Argument.AssertNotNullOrEmpty(baseResourceName, nameof(baseResourceName)); Argument.AssertNotNullOrEmpty(settingsResourceName, nameof(settingsResourceName)); - Argument.AssertNotNull(settings, nameof(settings)); + Argument.AssertNotNull(hybridComputeTargetResourceSettings, nameof(hybridComputeTargetResourceSettings)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, baseProvider, baseResourceType, baseResourceName, settingsResourceName, settings); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, baseProvider, baseResourceType, baseResourceName, settingsResourceName, hybridComputeTargetResourceSettings); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: case 201: { - Settings value = default; + HybridComputeTargetResourceSettings value = default; using var document = JsonDocument.Parse(message.Response.ContentStream); - value = Settings.DeserializeSettings(document.RootElement); + value = HybridComputeTargetResourceSettings.DeserializeHybridComputeTargetResourceSettings(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md index 65cf2f14fd02c..41ef5edd828f5 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md @@ -21,6 +21,7 @@ modelerfour: # Mitigate the duplication schema named 'ErrorDetail' lenient-model-deduplication: true use-model-reader-writer: true +enable-bicep-serialization: true #mgmt-debug: # show-serialized-names: true @@ -63,6 +64,9 @@ prepend-rp-prefix: - ProvisioningIssue - ProvisioningIssueSeverity - ProvisioningIssueType + - Gateway + - GatewayUpdate + - GatewayType list-exception: - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{baseProvider}/{baseResourceType}/{baseResourceName}/providers/Microsoft.HybridCompute/settings/{settingsResourceName} @@ -99,6 +103,13 @@ rename-mapping: RunCommandManagedIdentity.objectId: -|uuid StatusLevelTypes: HybridComputeStatusLevelType StatusTypes: HybridComputeStatusType + OSProfileWindowsConfiguration.patchSettings.enableHotpatching: IsHotpatchingEnabled + PatchSettingsStatus: HybridComputePatchSettingsStatus + Settings: HybridComputeTargetResourceSettings + OSProfileLinuxConfiguration.patchSettings.enableHotpatching: IsHotpatchingEnabled + +override-operation-name: + Settings_Update: UpdateTargetResourceSetting format-by-name-rules: 'tenantId': 'uuid' From 6bdb1820669837539bcbf247c4516cc6c976775d Mon Sep 17 00:00:00 2001 From: Yao Tong Date: Tue, 16 Jul 2024 17:01:07 -0400 Subject: [PATCH 5/8] add back license profile and esu PATCH --- ...rceManager.HybridCompute.netstandard2.0.cs | 19 +- .../Sample_HybridComputeLicenseResource.cs | 25 +- .../Generated/HybridComputeLicenseResource.cs | 79 ++++-- ...HybridComputeLicensePatch.Serialization.cs | 265 ++++++++++++++++++ .../Models/HybridComputeLicensePatch.cs | 59 ++++ .../RestOperations/LicensesRestOperations.cs | 90 ++++++ .../src/autorest.md | 13 +- 7 files changed, 496 insertions(+), 54 deletions(-) create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLicensePatch.Serialization.cs create mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLicensePatch.cs 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 efe56ef0e09be..e340ce37fd070 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 @@ -190,8 +190,8 @@ protected HybridComputeLicenseResource() { } Azure.ResourceManager.HybridCompute.HybridComputeLicenseData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.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.HybridComputeLicenseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridCompute.HybridComputeLicenseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridCompute.Models.HybridComputeLicensePatch 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.HybridComputeLicensePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class HybridComputeMachineCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -1102,6 +1102,21 @@ public HybridComputeLicenseDetails() { } 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 HybridComputeLicensePatch : Azure.ResourceManager.HybridCompute.Models.HybridComputeResourceUpdate, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HybridComputeLicensePatch() { } + public Azure.ResourceManager.HybridCompute.Models.LicenseCoreType? CoreType { get { throw null; } set { } } + public Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseEdition? Edition { get { throw null; } set { } } + public Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseType? LicenseType { get { throw null; } set { } } + public int? Processors { get { throw null; } set { } } + public Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseState? State { get { throw null; } set { } } + public Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseTarget? Target { get { throw null; } set { } } + Azure.ResourceManager.HybridCompute.Models.HybridComputeLicensePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.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.HybridComputeLicensePatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.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 { 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..fbad476b5d12a 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,13 +16,13 @@ namespace Azure.ResourceManager.HybridCompute.Samples { public partial class Sample_HybridComputeLicenseResource { - // Create or Update a License + // Update a License [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_CreateOrUpdateALicense() + public async Task Update_UpdateALicense() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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. + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/license/License_Update.json + // this example is just showing the usage of "Licenses_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(); @@ -38,19 +38,16 @@ public async Task Update_CreateOrUpdateALicense() HybridComputeLicenseResource hybridComputeLicense = client.GetHybridComputeLicenseResource(hybridComputeLicenseResourceId); // invoke the operation - HybridComputeLicenseData data = new HybridComputeLicenseData(new AzureLocation("eastus2euap")) + HybridComputeLicensePatch patch = new HybridComputeLicensePatch() { LicenseType = HybridComputeLicenseType.Esu, - LicenseDetails = new HybridComputeLicenseDetails() - { - State = HybridComputeLicenseState.Activated, - Target = HybridComputeLicenseTarget.WindowsServer2012, - Edition = HybridComputeLicenseEdition.DataCenter, - LicenseCoreType = LicenseCoreType.PCore, - Processors = 6, - }, + State = HybridComputeLicenseState.Activated, + Target = HybridComputeLicenseTarget.WindowsServer2012, + Edition = HybridComputeLicenseEdition.DataCenter, + CoreType = LicenseCoreType.PCore, + Processors = 6, }; - ArmOperation lro = await hybridComputeLicense.UpdateAsync(WaitUntil.Completed, data); + ArmOperation lro = await hybridComputeLicense.UpdateAsync(WaitUntil.Completed, patch); HybridComputeLicenseResource result = lro.Value; // the variable result is a resource, you could call other operations on this instance as well diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseResource.cs index d9b03e64d433f..6f58ceec422aa 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseResource.cs @@ -12,6 +12,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Core.Pipeline; +using Azure.ResourceManager.HybridCompute.Models; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.HybridCompute @@ -254,7 +255,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel } /// - /// The operation to create or update a license. + /// The operation to update a license. /// /// /// Request Path @@ -262,7 +263,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Operation Id - /// Licenses_CreateOrUpdate + /// Licenses_Update /// /// /// Default Api Version @@ -275,19 +276,19 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// 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 license operation. + /// Parameters supplied to the Update license operation. /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, HybridComputeLicenseData data, CancellationToken cancellationToken = default) + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, HybridComputeLicensePatch patch, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(data, nameof(data)); + Argument.AssertNotNull(patch, nameof(patch)); using var scope = _hybridComputeLicenseLicensesClientDiagnostics.CreateScope("HybridComputeLicenseResource.Update"); scope.Start(); try { - var response = await _hybridComputeLicenseLicensesRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new HybridComputeArmOperation(new HybridComputeLicenseOperationSource(Client), _hybridComputeLicenseLicensesClientDiagnostics, Pipeline, _hybridComputeLicenseLicensesRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data).Request, response, OperationFinalStateVia.Location); + var response = await _hybridComputeLicenseLicensesRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new HybridComputeArmOperation(new HybridComputeLicenseOperationSource(Client), _hybridComputeLicenseLicensesClientDiagnostics, Pipeline, _hybridComputeLicenseLicensesRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -300,7 +301,7 @@ public virtual async Task> UpdateAsyn } /// - /// The operation to create or update a license. + /// The operation to update a license. /// /// /// Request Path @@ -308,7 +309,7 @@ public virtual async Task> UpdateAsyn /// /// /// Operation Id - /// Licenses_CreateOrUpdate + /// Licenses_Update /// /// /// Default Api Version @@ -321,19 +322,19 @@ public virtual async Task> UpdateAsyn /// /// /// 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 license operation. + /// Parameters supplied to the Update license operation. /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, HybridComputeLicenseData data, CancellationToken cancellationToken = default) + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, HybridComputeLicensePatch patch, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(data, nameof(data)); + Argument.AssertNotNull(patch, nameof(patch)); using var scope = _hybridComputeLicenseLicensesClientDiagnostics.CreateScope("HybridComputeLicenseResource.Update"); scope.Start(); try { - var response = _hybridComputeLicenseLicensesRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data, cancellationToken); - var operation = new HybridComputeArmOperation(new HybridComputeLicenseOperationSource(Client), _hybridComputeLicenseLicensesClientDiagnostics, Pipeline, _hybridComputeLicenseLicensesRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data).Request, response, OperationFinalStateVia.Location); + var response = _hybridComputeLicenseLicensesRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new HybridComputeArmOperation(new HybridComputeLicenseOperationSource(Client), _hybridComputeLicenseLicensesClientDiagnostics, Pipeline, _hybridComputeLicenseLicensesRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -390,8 +391,13 @@ public virtual async Task> AddTagAsync(st 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 HybridComputeLicensePatch(); + 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()); } } @@ -447,8 +453,13 @@ public virtual Response AddTag(string key, string else { var current = Get(cancellationToken: cancellationToken).Value.Data; - current.Tags[key] = value; - var result = Update(WaitUntil.Completed, current, cancellationToken: cancellationToken); + var patch = new HybridComputeLicensePatch(); + 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()); } } @@ -503,8 +514,9 @@ public virtual async Task> SetTagsAsync(I 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 HybridComputeLicensePatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(result.Value, result.GetRawResponse()); } } @@ -559,8 +571,9 @@ public virtual Response SetTags(IDictionary> RemoveTagAsync 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 HybridComputeLicensePatch(); + 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()); } } @@ -669,8 +687,13 @@ public virtual Response RemoveTag(string key, Canc else { var current = Get(cancellationToken: cancellationToken).Value.Data; - current.Tags.Remove(key); - var result = Update(WaitUntil.Completed, current, cancellationToken: cancellationToken); + var patch = new HybridComputeLicensePatch(); + 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/Models/HybridComputeLicensePatch.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLicensePatch.Serialization.cs new file mode 100644 index 0000000000000..891a0c18b4374 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLicensePatch.Serialization.cs @@ -0,0 +1,265 @@ +// 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 HybridComputeLicensePatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HybridComputeLicensePatch)} does not support writing '{format}' format."); + } + + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(LicenseType)) + { + writer.WritePropertyName("licenseType"u8); + writer.WriteStringValue(LicenseType.Value.ToString()); + } + writer.WritePropertyName("licenseDetails"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.Value.ToString()); + } + if (Optional.IsDefined(Target)) + { + writer.WritePropertyName("target"u8); + writer.WriteStringValue(Target.Value.ToString()); + } + if (Optional.IsDefined(Edition)) + { + writer.WritePropertyName("edition"u8); + writer.WriteStringValue(Edition.Value.ToString()); + } + if (Optional.IsDefined(CoreType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(CoreType.Value.ToString()); + } + if (Optional.IsDefined(Processors)) + { + writer.WritePropertyName("processors"u8); + writer.WriteNumberValue(Processors.Value); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + writer.WriteEndObject(); + } + + HybridComputeLicensePatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HybridComputeLicensePatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHybridComputeLicensePatch(document.RootElement, options); + } + + internal static HybridComputeLicensePatch DeserializeHybridComputeLicensePatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + HybridComputeLicenseType? licenseType = default; + HybridComputeLicenseState? state = default; + HybridComputeLicenseTarget? target = default; + HybridComputeLicenseEdition? edition = default; + LicenseCoreType? type = default; + int? processors = 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("licenseType"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + licenseType = new HybridComputeLicenseType(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("licenseDetails"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property1 in property0.Value.EnumerateObject()) + { + if (property1.NameEquals("state"u8)) + { + if (property1.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + state = new HybridComputeLicenseState(property1.Value.GetString()); + continue; + } + if (property1.NameEquals("target"u8)) + { + if (property1.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + target = new HybridComputeLicenseTarget(property1.Value.GetString()); + continue; + } + if (property1.NameEquals("edition"u8)) + { + if (property1.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + edition = new HybridComputeLicenseEdition(property1.Value.GetString()); + continue; + } + if (property1.NameEquals("type"u8)) + { + if (property1.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new LicenseCoreType(property1.Value.GetString()); + continue; + } + if (property1.NameEquals("processors"u8)) + { + if (property1.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + processors = property1.Value.GetInt32(); + continue; + } + } + continue; + } + } + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HybridComputeLicensePatch( + tags ?? new ChangeTrackingDictionary(), + serializedAdditionalRawData, + licenseType, + state, + target, + edition, + type, + processors); + } + + 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(HybridComputeLicensePatch)} does not support writing '{options.Format}' format."); + } + } + + HybridComputeLicensePatch 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 DeserializeHybridComputeLicensePatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HybridComputeLicensePatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLicensePatch.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLicensePatch.cs new file mode 100644 index 0000000000000..26f7ae1d2cfc4 --- /dev/null +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLicensePatch.cs @@ -0,0 +1,59 @@ +// 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 HybridComputeLicensePatch : HybridComputeResourceUpdate + { + /// Initializes a new instance of . + public HybridComputeLicensePatch() + { + } + + /// Initializes a new instance of . + /// Resource tags. + /// Keeps track of any properties unknown to the library. + /// The type of the license resource. + /// Describes the state of the license. + /// Describes the license target server. + /// Describes the edition of the license. The values are either Standard or Datacenter. + /// Describes the license core type (pCore or vCore). + /// Describes the number of processors. + internal HybridComputeLicensePatch(IDictionary tags, IDictionary serializedAdditionalRawData, HybridComputeLicenseType? licenseType, HybridComputeLicenseState? state, HybridComputeLicenseTarget? target, HybridComputeLicenseEdition? edition, LicenseCoreType? coreType, int? processors) : base(tags, serializedAdditionalRawData) + { + LicenseType = licenseType; + State = state; + Target = target; + Edition = edition; + CoreType = coreType; + Processors = processors; + } + + /// The type of the license resource. + [WirePath("properties.licenseType")] + public HybridComputeLicenseType? LicenseType { get; set; } + /// Describes the state of the license. + [WirePath("properties.state")] + public HybridComputeLicenseState? State { get; set; } + /// Describes the license target server. + [WirePath("properties.target")] + public HybridComputeLicenseTarget? Target { get; set; } + /// Describes the edition of the license. The values are either Standard or Datacenter. + [WirePath("properties.edition")] + public HybridComputeLicenseEdition? Edition { get; set; } + /// Describes the license core type (pCore or vCore). + [WirePath("properties.type")] + public LicenseCoreType? CoreType { get; set; } + /// Describes the number of processors. + [WirePath("properties.processors")] + public int? Processors { get; set; } + } +} 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..e61434094eb66 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/LicensesRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/LicensesRestOperations.cs @@ -126,6 +126,96 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, } } + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string licenseName, HybridComputeLicensePatch 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/licenses/", false); + uri.AppendPath(licenseName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string licenseName, HybridComputeLicensePatch 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/licenses/", false); + uri.AppendPath(licenseName, 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 license. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the license. + /// Parameters supplied to the Update license 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 licenseName, HybridComputeLicensePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(licenseName, nameof(licenseName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, licenseName, patch); + 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 update a license. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the license. + /// Parameters supplied to the Update license 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 licenseName, HybridComputeLicensePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(licenseName, nameof(licenseName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, licenseName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string licenseName) { var uri = new RawRequestUriBuilder(); diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md index 41ef5edd828f5..ca4d6a4bedb36 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md @@ -257,20 +257,13 @@ directive: # we don't want user to interact with them / we don't support some operations - remove-operation: MachineRunCommands_Update #PATCH + # internal operations - remove-operation: AgentVersion_List - remove-operation: AgentVersion_Get + # we don't use them, pending to remove in the future - remove-operation: HybridIdentityMetadata_Get - remove-operation: HybridIdentityMetadata_ListByMachines - - - remove-operation: Licenses_ValidateLicense - - remove-operation: Licenses_Update #PATCH - - - remove-operation: LicenseProfiles_Get - - remove-operation: LicenseProfiles_Delete - - remove-operation: LicenseProfiles_Update - - remove-operation: LicenseProfiles_List - - remove-operation: LicenseProfiles_CreateOrUpdate - + # we don't want user to interact with them - remove-operation: Settings_Get - remove-operation: Settings_Patch From da25d56ebb121c2ff22b8764de085d02b615dafd Mon Sep 17 00:00:00 2001 From: Yao Tong Date: Wed, 17 Jul 2024 13:49:20 -0400 Subject: [PATCH 6/8] remove license patch --- .../Sample_HybridComputeLicenseResource.cs | 25 +- .../Generated/HybridComputeLicenseResource.cs | 79 ++---- ...HybridComputeLicensePatch.Serialization.cs | 265 ------------------ .../Models/HybridComputeLicensePatch.cs | 59 ---- .../RestOperations/LicensesRestOperations.cs | 90 ------ .../src/autorest.md | 2 + 6 files changed, 44 insertions(+), 476 deletions(-) delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLicensePatch.Serialization.cs delete mode 100644 sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLicensePatch.cs 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 fbad476b5d12a..88669e9d01275 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,13 +16,13 @@ namespace Azure.ResourceManager.HybridCompute.Samples { public partial class Sample_HybridComputeLicenseResource { - // Update a License + // Create or Update a License [NUnit.Framework.Test] [NUnit.Framework.Ignore("Only verifying that the sample builds")] - public async Task Update_UpdateALicense() + public async Task Update_CreateOrUpdateALicense() { - // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/examples/license/License_Update.json - // this example is just showing the usage of "Licenses_Update" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: specification/hybridcompute/resource-manager/Microsoft.HybridCompute/preview/2024-05-20-preview/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 TokenCredential cred = new DefaultAzureCredential(); @@ -38,16 +38,19 @@ public async Task Update_UpdateALicense() HybridComputeLicenseResource hybridComputeLicense = client.GetHybridComputeLicenseResource(hybridComputeLicenseResourceId); // invoke the operation - HybridComputeLicensePatch patch = new HybridComputeLicensePatch() + HybridComputeLicenseData data = new HybridComputeLicenseData(new AzureLocation("eastus2euap")) { LicenseType = HybridComputeLicenseType.Esu, - State = HybridComputeLicenseState.Activated, - Target = HybridComputeLicenseTarget.WindowsServer2012, - Edition = HybridComputeLicenseEdition.DataCenter, - CoreType = LicenseCoreType.PCore, - Processors = 6, + LicenseDetails = new HybridComputeLicenseDetails() + { + State = HybridComputeLicenseState.Activated, + Target = HybridComputeLicenseTarget.WindowsServer2012, + Edition = HybridComputeLicenseEdition.DataCenter, + LicenseCoreType = LicenseCoreType.PCore, + Processors = 6, + }, }; - ArmOperation lro = await hybridComputeLicense.UpdateAsync(WaitUntil.Completed, patch); + ArmOperation lro = await hybridComputeLicense.UpdateAsync(WaitUntil.Completed, data); HybridComputeLicenseResource result = lro.Value; // the variable result is a resource, you could call other operations on this instance as well diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseResource.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseResource.cs index 6f58ceec422aa..d9b03e64d433f 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseResource.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/HybridComputeLicenseResource.cs @@ -12,7 +12,6 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Core.Pipeline; -using Azure.ResourceManager.HybridCompute.Models; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.HybridCompute @@ -255,7 +254,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel } /// - /// The operation to update a license. + /// The operation to create or update a license. /// /// /// Request Path @@ -263,7 +262,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Operation Id - /// Licenses_Update + /// Licenses_CreateOrUpdate /// /// /// Default Api Version @@ -276,19 +275,19 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// 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 operation. + /// Parameters supplied to the Create license operation. /// The cancellation token to use. - /// is null. - public virtual async Task> UpdateAsync(WaitUntil waitUntil, HybridComputeLicensePatch patch, CancellationToken cancellationToken = default) + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, HybridComputeLicenseData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(data, nameof(data)); using var scope = _hybridComputeLicenseLicensesClientDiagnostics.CreateScope("HybridComputeLicenseResource.Update"); scope.Start(); try { - var response = await _hybridComputeLicenseLicensesRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); - var operation = new HybridComputeArmOperation(new HybridComputeLicenseOperationSource(Client), _hybridComputeLicenseLicensesClientDiagnostics, Pipeline, _hybridComputeLicenseLicensesRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = await _hybridComputeLicenseLicensesRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new HybridComputeArmOperation(new HybridComputeLicenseOperationSource(Client), _hybridComputeLicenseLicensesClientDiagnostics, Pipeline, _hybridComputeLicenseLicensesRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -301,7 +300,7 @@ public virtual async Task> UpdateAsyn } /// - /// The operation to update a license. + /// The operation to create or update a license. /// /// /// Request Path @@ -309,7 +308,7 @@ public virtual async Task> UpdateAsyn /// /// /// Operation Id - /// Licenses_Update + /// Licenses_CreateOrUpdate /// /// /// Default Api Version @@ -322,19 +321,19 @@ public virtual async Task> UpdateAsyn /// /// /// 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 operation. + /// Parameters supplied to the Create license operation. /// The cancellation token to use. - /// is null. - public virtual ArmOperation Update(WaitUntil waitUntil, HybridComputeLicensePatch patch, CancellationToken cancellationToken = default) + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, HybridComputeLicenseData data, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(data, nameof(data)); using var scope = _hybridComputeLicenseLicensesClientDiagnostics.CreateScope("HybridComputeLicenseResource.Update"); scope.Start(); try { - var response = _hybridComputeLicenseLicensesRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); - var operation = new HybridComputeArmOperation(new HybridComputeLicenseOperationSource(Client), _hybridComputeLicenseLicensesClientDiagnostics, Pipeline, _hybridComputeLicenseLicensesRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + var response = _hybridComputeLicenseLicensesRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data, cancellationToken); + var operation = new HybridComputeArmOperation(new HybridComputeLicenseOperationSource(Client), _hybridComputeLicenseLicensesClientDiagnostics, Pipeline, _hybridComputeLicenseLicensesRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -391,13 +390,8 @@ public virtual async Task> AddTagAsync(st else { var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new HybridComputeLicensePatch(); - 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); + current.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, current, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(result.Value, result.GetRawResponse()); } } @@ -453,13 +447,8 @@ public virtual Response AddTag(string key, string else { var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new HybridComputeLicensePatch(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags[key] = value; - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + current.Tags[key] = value; + var result = Update(WaitUntil.Completed, current, cancellationToken: cancellationToken); return Response.FromValue(result.Value, result.GetRawResponse()); } } @@ -514,9 +503,8 @@ public virtual async Task> SetTagsAsync(I else { var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new HybridComputeLicensePatch(); - patch.Tags.ReplaceWith(tags); - var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + current.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, current, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(result.Value, result.GetRawResponse()); } } @@ -571,9 +559,8 @@ public virtual Response SetTags(IDictionary> RemoveTagAsync else { var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; - var patch = new HybridComputeLicensePatch(); - 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); + current.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, current, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(result.Value, result.GetRawResponse()); } } @@ -687,13 +669,8 @@ public virtual Response RemoveTag(string key, Canc else { var current = Get(cancellationToken: cancellationToken).Value.Data; - var patch = new HybridComputeLicensePatch(); - foreach (var tag in current.Tags) - { - patch.Tags.Add(tag); - } - patch.Tags.Remove(key); - var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + current.Tags.Remove(key); + var result = Update(WaitUntil.Completed, current, cancellationToken: cancellationToken); return Response.FromValue(result.Value, result.GetRawResponse()); } } diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLicensePatch.Serialization.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLicensePatch.Serialization.cs deleted file mode 100644 index 891a0c18b4374..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLicensePatch.Serialization.cs +++ /dev/null @@ -1,265 +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 HybridComputeLicensePatch : IUtf8JsonSerializable, IJsonModel - { - void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); - - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(HybridComputeLicensePatch)} does not support writing '{format}' format."); - } - - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(Tags)) - { - writer.WritePropertyName("tags"u8); - writer.WriteStartObject(); - foreach (var item in Tags) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - writer.WritePropertyName("properties"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(LicenseType)) - { - writer.WritePropertyName("licenseType"u8); - writer.WriteStringValue(LicenseType.Value.ToString()); - } - writer.WritePropertyName("licenseDetails"u8); - writer.WriteStartObject(); - if (Optional.IsDefined(State)) - { - writer.WritePropertyName("state"u8); - writer.WriteStringValue(State.Value.ToString()); - } - if (Optional.IsDefined(Target)) - { - writer.WritePropertyName("target"u8); - writer.WriteStringValue(Target.Value.ToString()); - } - if (Optional.IsDefined(Edition)) - { - writer.WritePropertyName("edition"u8); - writer.WriteStringValue(Edition.Value.ToString()); - } - if (Optional.IsDefined(CoreType)) - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(CoreType.Value.ToString()); - } - if (Optional.IsDefined(Processors)) - { - writer.WritePropertyName("processors"u8); - writer.WriteNumberValue(Processors.Value); - } - writer.WriteEndObject(); - writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); - } - - HybridComputeLicensePatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) - { - var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; - if (format != "J") - { - throw new FormatException($"The model {nameof(HybridComputeLicensePatch)} does not support reading '{format}' format."); - } - - using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeHybridComputeLicensePatch(document.RootElement, options); - } - - internal static HybridComputeLicensePatch DeserializeHybridComputeLicensePatch(JsonElement element, ModelReaderWriterOptions options = null) - { - options ??= ModelSerializationExtensions.WireOptions; - - if (element.ValueKind == JsonValueKind.Null) - { - return null; - } - IDictionary tags = default; - HybridComputeLicenseType? licenseType = default; - HybridComputeLicenseState? state = default; - HybridComputeLicenseTarget? target = default; - HybridComputeLicenseEdition? edition = default; - LicenseCoreType? type = default; - int? processors = 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("licenseType"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - licenseType = new HybridComputeLicenseType(property0.Value.GetString()); - continue; - } - if (property0.NameEquals("licenseDetails"u8)) - { - if (property0.Value.ValueKind == JsonValueKind.Null) - { - property0.ThrowNonNullablePropertyIsNull(); - continue; - } - foreach (var property1 in property0.Value.EnumerateObject()) - { - if (property1.NameEquals("state"u8)) - { - if (property1.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - state = new HybridComputeLicenseState(property1.Value.GetString()); - continue; - } - if (property1.NameEquals("target"u8)) - { - if (property1.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - target = new HybridComputeLicenseTarget(property1.Value.GetString()); - continue; - } - if (property1.NameEquals("edition"u8)) - { - if (property1.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - edition = new HybridComputeLicenseEdition(property1.Value.GetString()); - continue; - } - if (property1.NameEquals("type"u8)) - { - if (property1.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - type = new LicenseCoreType(property1.Value.GetString()); - continue; - } - if (property1.NameEquals("processors"u8)) - { - if (property1.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - processors = property1.Value.GetInt32(); - continue; - } - } - continue; - } - } - continue; - } - if (options.Format != "W") - { - rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); - } - } - serializedAdditionalRawData = rawDataDictionary; - return new HybridComputeLicensePatch( - tags ?? new ChangeTrackingDictionary(), - serializedAdditionalRawData, - licenseType, - state, - target, - edition, - type, - processors); - } - - 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(HybridComputeLicensePatch)} does not support writing '{options.Format}' format."); - } - } - - HybridComputeLicensePatch 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 DeserializeHybridComputeLicensePatch(document.RootElement, options); - } - default: - throw new FormatException($"The model {nameof(HybridComputeLicensePatch)} does not support reading '{options.Format}' format."); - } - } - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; - } -} diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLicensePatch.cs b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLicensePatch.cs deleted file mode 100644 index 26f7ae1d2cfc4..0000000000000 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/Models/HybridComputeLicensePatch.cs +++ /dev/null @@ -1,59 +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 HybridComputeLicensePatch : HybridComputeResourceUpdate - { - /// Initializes a new instance of . - public HybridComputeLicensePatch() - { - } - - /// Initializes a new instance of . - /// Resource tags. - /// Keeps track of any properties unknown to the library. - /// The type of the license resource. - /// Describes the state of the license. - /// Describes the license target server. - /// Describes the edition of the license. The values are either Standard or Datacenter. - /// Describes the license core type (pCore or vCore). - /// Describes the number of processors. - internal HybridComputeLicensePatch(IDictionary tags, IDictionary serializedAdditionalRawData, HybridComputeLicenseType? licenseType, HybridComputeLicenseState? state, HybridComputeLicenseTarget? target, HybridComputeLicenseEdition? edition, LicenseCoreType? coreType, int? processors) : base(tags, serializedAdditionalRawData) - { - LicenseType = licenseType; - State = state; - Target = target; - Edition = edition; - CoreType = coreType; - Processors = processors; - } - - /// The type of the license resource. - [WirePath("properties.licenseType")] - public HybridComputeLicenseType? LicenseType { get; set; } - /// Describes the state of the license. - [WirePath("properties.state")] - public HybridComputeLicenseState? State { get; set; } - /// Describes the license target server. - [WirePath("properties.target")] - public HybridComputeLicenseTarget? Target { get; set; } - /// Describes the edition of the license. The values are either Standard or Datacenter. - [WirePath("properties.edition")] - public HybridComputeLicenseEdition? Edition { get; set; } - /// Describes the license core type (pCore or vCore). - [WirePath("properties.type")] - public LicenseCoreType? CoreType { get; set; } - /// Describes the number of processors. - [WirePath("properties.processors")] - public int? Processors { get; set; } - } -} 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 e61434094eb66..174bfb4dad683 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/LicensesRestOperations.cs +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/Generated/RestOperations/LicensesRestOperations.cs @@ -126,96 +126,6 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string licenseName, HybridComputeLicensePatch 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/licenses/", false); - uri.AppendPath(licenseName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string licenseName, HybridComputeLicensePatch 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/licenses/", false); - uri.AppendPath(licenseName, 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 license. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the license. - /// Parameters supplied to the Update license 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 licenseName, HybridComputeLicensePatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(licenseName, nameof(licenseName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, licenseName, patch); - 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 update a license. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the license. - /// Parameters supplied to the Update license 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 licenseName, HybridComputeLicensePatch patch, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(licenseName, nameof(licenseName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, licenseName, patch); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string licenseName) { var uri = new RawRequestUriBuilder(); diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md index ca4d6a4bedb36..2e98e9065b1cf 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/src/autorest.md @@ -266,5 +266,7 @@ directive: # we don't want user to interact with them - remove-operation: Settings_Get - remove-operation: Settings_Patch + # adding it will remove HybridComputeLicenseData resource and create HybridComputeLicensePatch resouce and cause other ESU commands to fail + - remove-operation: Licenses_Update #PATCH ``` From e3a5795bb3f24c7eb3b760672fa607fa2e6b8d72 Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Fri, 19 Jul 2024 14:56:35 +0800 Subject: [PATCH 7/8] Update CHANGELOG.md --- .../Azure.ResourceManager.HybridCompute/CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/CHANGELOG.md b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/CHANGELOG.md index e3773165cfa93..fd6c58859d544 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-beta.10 (2024-07-12) +## 1.0.0-beta.10 (2024-07-19) ### Features Added @@ -91,4 +91,4 @@ This package follows the [new Azure SDK guidelines](https://azure.github.io/azur This package is a Public Preview version, so expect incompatible changes in subsequent releases as we improve the product. To provide feedback, submit an issue in our [Azure SDK for .NET GitHub repo](https://github.com/Azure/azure-sdk-for-net/issues). -> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). \ No newline at end of file +> NOTE: For more information about unified authentication, refer to [Microsoft Azure Identity documentation for .NET](https://docs.microsoft.com//dotnet/api/overview/azure/identity-readme?view=azure-dotnet). From 58e6fd9e75fb3cf7ffdf0564c6a97d47d4c929fe Mon Sep 17 00:00:00 2001 From: Arthur Ma Date: Fri, 19 Jul 2024 15:35:55 +0800 Subject: [PATCH 8/8] update --- .../CHANGELOG.md | 2 ++ ...rceManager.HybridCompute.netstandard2.0.cs | 19 ++----------------- 2 files changed, 4 insertions(+), 17 deletions(-) diff --git a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/CHANGELOG.md b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/CHANGELOG.md index fd6c58859d544..4b9c6f3b898f0 100644 --- a/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/CHANGELOG.md +++ b/sdk/hybridcompute/Azure.ResourceManager.HybridCompute/CHANGELOG.md @@ -5,6 +5,8 @@ ### 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) 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 e340ce37fd070..efe56ef0e09be 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 @@ -190,8 +190,8 @@ protected HybridComputeLicenseResource() { } Azure.ResourceManager.HybridCompute.HybridComputeLicenseData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } string System.ClientModel.Primitives.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.HybridComputeLicensePatch 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.HybridComputeLicensePatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridCompute.HybridComputeLicenseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.HybridCompute.HybridComputeLicenseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class HybridComputeMachineCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -1102,21 +1102,6 @@ public HybridComputeLicenseDetails() { } 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 HybridComputeLicensePatch : Azure.ResourceManager.HybridCompute.Models.HybridComputeResourceUpdate, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public HybridComputeLicensePatch() { } - public Azure.ResourceManager.HybridCompute.Models.LicenseCoreType? CoreType { get { throw null; } set { } } - public Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseEdition? Edition { get { throw null; } set { } } - public Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseType? LicenseType { get { throw null; } set { } } - public int? Processors { get { throw null; } set { } } - public Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseState? State { get { throw null; } set { } } - public Azure.ResourceManager.HybridCompute.Models.HybridComputeLicenseTarget? Target { get { throw null; } set { } } - Azure.ResourceManager.HybridCompute.Models.HybridComputeLicensePatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.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.HybridComputeLicensePatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.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 {