diff --git a/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/Azure.ResourceManager.CloudHealth.sln b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/Azure.ResourceManager.CloudHealth.sln
new file mode 100644
index 000000000000..1ac6623d8de4
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/Azure.ResourceManager.CloudHealth.sln
@@ -0,0 +1,56 @@
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.29709.97
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.ResourceManager.CloudHealth.Samples", "samples\Azure.ResourceManager.CloudHealth.Samples.csproj", "{7A2DFF15-5746-49F4-BD0F-C6C35337088A}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.CloudHealth", "src\Azure.ResourceManager.CloudHealth.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.CloudHealth.Tests", "tests\Azure.ResourceManager.CloudHealth.Tests.csproj", "{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU
+ {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU
+ {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU
+ {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU
+ {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU
+ {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE}
+ EndGlobalSection
+EndGlobal
diff --git a/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/CHANGELOG.md b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/CHANGELOG.md
new file mode 100644
index 000000000000..8b33f0fedccc
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/CHANGELOG.md
@@ -0,0 +1,11 @@
+# Release History
+
+## 1.0.0-beta.1 (Unreleased)
+
+### Features Added
+
+### Breaking Changes
+
+### Bugs Fixed
+
+### Other Changes
\ No newline at end of file
diff --git a/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/Directory.Build.props b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/Directory.Build.props
new file mode 100644
index 000000000000..63bd836ad44b
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/Directory.Build.props
@@ -0,0 +1,6 @@
+
+
+
+
diff --git a/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/README.md b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/README.md
new file mode 100644
index 000000000000..d1b46f05140a
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/README.md
@@ -0,0 +1,80 @@
+# Microsoft Azure CloudHealth management client library for .NET
+
+**[Describe the service briefly first.]**
+
+This library follows the [new Azure SDK guidelines](https://azure.github.io/azure-sdk/general_introduction.html), and provides many core capabilities:
+
+ - Support MSAL.NET, Azure.Identity is out of box for supporting MSAL.NET.
+ - Support [OpenTelemetry](https://opentelemetry.io/) for distributed tracing.
+ - HTTP pipeline with custom policies.
+ - Better error-handling.
+ - Support uniform telemetry across all languages.
+
+## Getting started
+
+### Install the package
+
+Install the Microsoft Azure CloudHealth management library for .NET with [NuGet](https://www.nuget.org/):
+
+```dotnetcli
+dotnet add package Azure.ResourceManager.CloudHealth --prerelease
+```
+
+### Prerequisites
+
+* You must have an [Microsoft Azure subscription](https://azure.microsoft.com/free/dotnet/).
+
+### Authenticate the Client
+
+To create an authenticated client and start interacting with Microsoft Azure resources, see the [quickstart guide here](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md).
+
+## Key concepts
+
+Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azure.github.io/azure-sdk/dotnet_introduction.html)
+
+## Documentation
+
+Documentation is available to help you learn how to use this package:
+
+- [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md).
+- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet).
+- [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md).
+
+## Examples
+
+Code samples for using the management library for .NET can be found in the following locations
+- [.NET Management Library Code Samples](https://aka.ms/azuresdk-net-mgmt-samples)
+
+## Troubleshooting
+
+- File an issue via [GitHub Issues](https://github.com/Azure/azure-sdk-for-net/issues).
+- Check [previous questions](https://stackoverflow.com/questions/tagged/azure+.net) or ask new ones on Stack Overflow using Azure and .NET tags.
+
+## Next steps
+
+For more information about Microsoft Azure SDK, see [this website](https://azure.github.io/azure-sdk/).
+
+## Contributing
+
+For details on contributing to this repository, see the [contributing
+guide][cg].
+
+This project welcomes contributions and suggestions. Most contributions
+require you to agree to a Contributor License Agreement (CLA) declaring
+that you have the right to, and actually do, grant us the rights to use
+your contribution. For details, visit .
+
+When you submit a pull request, a CLA-bot will automatically determine
+whether you need to provide a CLA and decorate the PR appropriately
+(for example, label, comment). Follow the instructions provided by the
+bot. You'll only need to do this action once across all repositories
+using our CLA.
+
+This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For
+more information, see the [Code of Conduct FAQ][coc_faq] or contact
+ with any other questions or comments.
+
+
+[cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md
+[coc]: https://opensource.microsoft.com/codeofconduct/
+[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
\ No newline at end of file
diff --git a/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/assets.json b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/assets.json
new file mode 100644
index 000000000000..6dd722f0b712
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/assets.json
@@ -0,0 +1,7 @@
+
+{
+ "AssetsRepo": "Azure/azure-sdk-assets",
+ "AssetsRepoPrefixPath": "net",
+ "TagPrefix": "net/cloudhealth/Azure.ResourceManager.CloudHealth",
+ "Tag": ""
+}
diff --git a/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Azure.ResourceManager.CloudHealth.Samples.csproj b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Azure.ResourceManager.CloudHealth.Samples.csproj
new file mode 100644
index 000000000000..e2724e938c57
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Azure.ResourceManager.CloudHealth.Samples.csproj
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Generated/Samples/Sample_AuthenticationSettingCollection.cs b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Generated/Samples/Sample_AuthenticationSettingCollection.cs
new file mode 100644
index 000000000000..0a63a7cb2c25
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Generated/Samples/Sample_AuthenticationSettingCollection.cs
@@ -0,0 +1,203 @@
+// 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.CloudHealth.Models;
+using NUnit.Framework;
+
+namespace Azure.ResourceManager.CloudHealth.Samples
+{
+ public partial class Sample_AuthenticationSettingCollection
+ {
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task CreateOrUpdate_AuthenticationSettingsCreateOrUpdate()
+ {
+ // Generated from example definition: 2023-10-01-preview/AuthenticationSettings_CreateOrUpdate.json
+ // this example is just showing the usage of "AuthenticationSetting_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 HealthModelResource created on azure
+ // for more information of creating HealthModelResource, please refer to the document of HealthModelResource
+ string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ string resourceGroupName = "myResourceGroup";
+ string healthModelName = "myHealthModel";
+ ResourceIdentifier healthModelResourceId = HealthModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName);
+ HealthModelResource healthModel = client.GetHealthModelResource(healthModelResourceId);
+
+ // get the collection of this AuthenticationSettingResource
+ AuthenticationSettingCollection collection = healthModel.GetAuthenticationSettings();
+
+ // invoke the operation
+ string authenticationSettingName = "myAuthSetting";
+ AuthenticationSettingData data = new AuthenticationSettingData
+ {
+ Properties = new ManagedIdentityAuthenticationSettingProperties("SystemAssigned")
+ {
+ DisplayName = "myDisplayName",
+ },
+ };
+ ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, authenticationSettingName, data);
+ AuthenticationSettingResource 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
+ AuthenticationSettingData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Get_AuthenticationSettingsGet()
+ {
+ // Generated from example definition: 2023-10-01-preview/AuthenticationSettings_Get.json
+ // this example is just showing the usage of "AuthenticationSetting_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 HealthModelResource created on azure
+ // for more information of creating HealthModelResource, please refer to the document of HealthModelResource
+ string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ string resourceGroupName = "my-resource-group";
+ string healthModelName = "my-health-model";
+ ResourceIdentifier healthModelResourceId = HealthModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName);
+ HealthModelResource healthModel = client.GetHealthModelResource(healthModelResourceId);
+
+ // get the collection of this AuthenticationSettingResource
+ AuthenticationSettingCollection collection = healthModel.GetAuthenticationSettings();
+
+ // invoke the operation
+ string authenticationSettingName = "my-auth-setting";
+ AuthenticationSettingResource result = await collection.GetAsync(authenticationSettingName);
+
+ // 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
+ AuthenticationSettingData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task GetAll_AuthenticationSettingsListByHealthModel()
+ {
+ // Generated from example definition: 2023-10-01-preview/AuthenticationSettings_ListByHealthModel.json
+ // this example is just showing the usage of "AuthenticationSetting_ListByHealthModel" 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 HealthModelResource created on azure
+ // for more information of creating HealthModelResource, please refer to the document of HealthModelResource
+ string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ string resourceGroupName = "my-resource-group";
+ string healthModelName = "my-health-model";
+ ResourceIdentifier healthModelResourceId = HealthModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName);
+ HealthModelResource healthModel = client.GetHealthModelResource(healthModelResourceId);
+
+ // get the collection of this AuthenticationSettingResource
+ AuthenticationSettingCollection collection = healthModel.GetAuthenticationSettings();
+
+ // invoke the operation and iterate over the result
+ await foreach (AuthenticationSettingResource 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
+ AuthenticationSettingData resourceData = item.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ Console.WriteLine("Succeeded");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Exists_AuthenticationSettingsGet()
+ {
+ // Generated from example definition: 2023-10-01-preview/AuthenticationSettings_Get.json
+ // this example is just showing the usage of "AuthenticationSetting_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 HealthModelResource created on azure
+ // for more information of creating HealthModelResource, please refer to the document of HealthModelResource
+ string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ string resourceGroupName = "my-resource-group";
+ string healthModelName = "my-health-model";
+ ResourceIdentifier healthModelResourceId = HealthModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName);
+ HealthModelResource healthModel = client.GetHealthModelResource(healthModelResourceId);
+
+ // get the collection of this AuthenticationSettingResource
+ AuthenticationSettingCollection collection = healthModel.GetAuthenticationSettings();
+
+ // invoke the operation
+ string authenticationSettingName = "my-auth-setting";
+ bool result = await collection.ExistsAsync(authenticationSettingName);
+
+ Console.WriteLine($"Succeeded: {result}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task GetIfExists_AuthenticationSettingsGet()
+ {
+ // Generated from example definition: 2023-10-01-preview/AuthenticationSettings_Get.json
+ // this example is just showing the usage of "AuthenticationSetting_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 HealthModelResource created on azure
+ // for more information of creating HealthModelResource, please refer to the document of HealthModelResource
+ string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ string resourceGroupName = "my-resource-group";
+ string healthModelName = "my-health-model";
+ ResourceIdentifier healthModelResourceId = HealthModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName);
+ HealthModelResource healthModel = client.GetHealthModelResource(healthModelResourceId);
+
+ // get the collection of this AuthenticationSettingResource
+ AuthenticationSettingCollection collection = healthModel.GetAuthenticationSettings();
+
+ // invoke the operation
+ string authenticationSettingName = "my-auth-setting";
+ NullableResponse response = await collection.GetIfExistsAsync(authenticationSettingName);
+ AuthenticationSettingResource 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
+ AuthenticationSettingData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+ }
+ }
+}
diff --git a/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Generated/Samples/Sample_AuthenticationSettingResource.cs b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Generated/Samples/Sample_AuthenticationSettingResource.cs
new file mode 100644
index 000000000000..a1ebc193e539
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Generated/Samples/Sample_AuthenticationSettingResource.cs
@@ -0,0 +1,116 @@
+// 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.CloudHealth.Models;
+using NUnit.Framework;
+
+namespace Azure.ResourceManager.CloudHealth.Samples
+{
+ public partial class Sample_AuthenticationSettingResource
+ {
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Get_AuthenticationSettingsGet()
+ {
+ // Generated from example definition: 2023-10-01-preview/AuthenticationSettings_Get.json
+ // this example is just showing the usage of "AuthenticationSetting_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 AuthenticationSettingResource created on azure
+ // for more information of creating AuthenticationSettingResource, please refer to the document of AuthenticationSettingResource
+ string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ string resourceGroupName = "my-resource-group";
+ string healthModelName = "my-health-model";
+ string authenticationSettingName = "my-auth-setting";
+ ResourceIdentifier authenticationSettingResourceId = AuthenticationSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName, authenticationSettingName);
+ AuthenticationSettingResource authenticationSetting = client.GetAuthenticationSettingResource(authenticationSettingResourceId);
+
+ // invoke the operation
+ AuthenticationSettingResource result = await authenticationSetting.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
+ AuthenticationSettingData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Delete_AuthenticationSettingsDelete()
+ {
+ // Generated from example definition: 2023-10-01-preview/AuthenticationSettings_Delete.json
+ // this example is just showing the usage of "AuthenticationSetting_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 AuthenticationSettingResource created on azure
+ // for more information of creating AuthenticationSettingResource, please refer to the document of AuthenticationSettingResource
+ string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ string resourceGroupName = "my-resource-group";
+ string healthModelName = "my-health-model";
+ string authenticationSettingName = "my-auth-setting";
+ ResourceIdentifier authenticationSettingResourceId = AuthenticationSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName, authenticationSettingName);
+ AuthenticationSettingResource authenticationSetting = client.GetAuthenticationSettingResource(authenticationSettingResourceId);
+
+ // invoke the operation
+ await authenticationSetting.DeleteAsync(WaitUntil.Completed);
+
+ Console.WriteLine("Succeeded");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Update_AuthenticationSettingsCreateOrUpdate()
+ {
+ // Generated from example definition: 2023-10-01-preview/AuthenticationSettings_CreateOrUpdate.json
+ // this example is just showing the usage of "AuthenticationSetting_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 AuthenticationSettingResource created on azure
+ // for more information of creating AuthenticationSettingResource, please refer to the document of AuthenticationSettingResource
+ string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ string resourceGroupName = "myResourceGroup";
+ string healthModelName = "myHealthModel";
+ string authenticationSettingName = "myAuthSetting";
+ ResourceIdentifier authenticationSettingResourceId = AuthenticationSettingResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName, authenticationSettingName);
+ AuthenticationSettingResource authenticationSetting = client.GetAuthenticationSettingResource(authenticationSettingResourceId);
+
+ // invoke the operation
+ AuthenticationSettingData data = new AuthenticationSettingData
+ {
+ Properties = new ManagedIdentityAuthenticationSettingProperties("SystemAssigned")
+ {
+ DisplayName = "myDisplayName",
+ },
+ };
+ ArmOperation lro = await authenticationSetting.UpdateAsync(WaitUntil.Completed, data);
+ AuthenticationSettingResource 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
+ AuthenticationSettingData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+ }
+}
diff --git a/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Generated/Samples/Sample_DiscoveryRuleCollection.cs b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Generated/Samples/Sample_DiscoveryRuleCollection.cs
new file mode 100644
index 000000000000..50503f13d0c7
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Generated/Samples/Sample_DiscoveryRuleCollection.cs
@@ -0,0 +1,203 @@
+// 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.CloudHealth.Models;
+using NUnit.Framework;
+
+namespace Azure.ResourceManager.CloudHealth.Samples
+{
+ public partial class Sample_DiscoveryRuleCollection
+ {
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task CreateOrUpdate_DiscoveryRulesCreateOrUpdate()
+ {
+ // Generated from example definition: 2023-10-01-preview/DiscoveryRules_CreateOrUpdate.json
+ // this example is just showing the usage of "DiscoveryRule_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 HealthModelResource created on azure
+ // for more information of creating HealthModelResource, please refer to the document of HealthModelResource
+ string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ string resourceGroupName = "myResourceGroup";
+ string healthModelName = "myHealthModel";
+ ResourceIdentifier healthModelResourceId = HealthModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName);
+ HealthModelResource healthModel = client.GetHealthModelResource(healthModelResourceId);
+
+ // get the collection of this DiscoveryRuleResource
+ DiscoveryRuleCollection collection = healthModel.GetDiscoveryRules();
+
+ // invoke the operation
+ string discoveryRuleName = "myDiscoveryRule";
+ DiscoveryRuleData data = new DiscoveryRuleData
+ {
+ Properties = new DiscoveryRuleProperties("resources | where subscriptionId == '7ddfffd7-9b32-40df-1234-828cbd55d6f4' | where resourceGroup == 'my-rg'", "authSetting1", DiscoveryRuleRelationshipDiscoveryBehavior.Enabled, DiscoveryRuleRecommendedSignalsBehavior.Enabled, null)
+ {
+ DisplayName = "myDisplayName",
+ },
+ };
+ ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, discoveryRuleName, data);
+ DiscoveryRuleResource 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
+ DiscoveryRuleData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Get_DiscoveryRulesGet()
+ {
+ // Generated from example definition: 2023-10-01-preview/DiscoveryRules_Get.json
+ // this example is just showing the usage of "DiscoveryRule_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 HealthModelResource created on azure
+ // for more information of creating HealthModelResource, please refer to the document of HealthModelResource
+ string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ string resourceGroupName = "myResourceGroup";
+ string healthModelName = "myHealthModel";
+ ResourceIdentifier healthModelResourceId = HealthModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName);
+ HealthModelResource healthModel = client.GetHealthModelResource(healthModelResourceId);
+
+ // get the collection of this DiscoveryRuleResource
+ DiscoveryRuleCollection collection = healthModel.GetDiscoveryRules();
+
+ // invoke the operation
+ string discoveryRuleName = "myDiscoveryRule";
+ DiscoveryRuleResource result = await collection.GetAsync(discoveryRuleName);
+
+ // 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
+ DiscoveryRuleData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task GetAll_DiscoveryRulesListByHealthModel()
+ {
+ // Generated from example definition: 2023-10-01-preview/DiscoveryRules_ListByHealthModel.json
+ // this example is just showing the usage of "DiscoveryRule_ListByHealthModel" 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 HealthModelResource created on azure
+ // for more information of creating HealthModelResource, please refer to the document of HealthModelResource
+ string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ string resourceGroupName = "my-resource-group";
+ string healthModelName = "my-health-model";
+ ResourceIdentifier healthModelResourceId = HealthModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName);
+ HealthModelResource healthModel = client.GetHealthModelResource(healthModelResourceId);
+
+ // get the collection of this DiscoveryRuleResource
+ DiscoveryRuleCollection collection = healthModel.GetDiscoveryRules();
+
+ // invoke the operation and iterate over the result
+ await foreach (DiscoveryRuleResource 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
+ DiscoveryRuleData resourceData = item.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ Console.WriteLine("Succeeded");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Exists_DiscoveryRulesGet()
+ {
+ // Generated from example definition: 2023-10-01-preview/DiscoveryRules_Get.json
+ // this example is just showing the usage of "DiscoveryRule_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 HealthModelResource created on azure
+ // for more information of creating HealthModelResource, please refer to the document of HealthModelResource
+ string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ string resourceGroupName = "myResourceGroup";
+ string healthModelName = "myHealthModel";
+ ResourceIdentifier healthModelResourceId = HealthModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName);
+ HealthModelResource healthModel = client.GetHealthModelResource(healthModelResourceId);
+
+ // get the collection of this DiscoveryRuleResource
+ DiscoveryRuleCollection collection = healthModel.GetDiscoveryRules();
+
+ // invoke the operation
+ string discoveryRuleName = "myDiscoveryRule";
+ bool result = await collection.ExistsAsync(discoveryRuleName);
+
+ Console.WriteLine($"Succeeded: {result}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task GetIfExists_DiscoveryRulesGet()
+ {
+ // Generated from example definition: 2023-10-01-preview/DiscoveryRules_Get.json
+ // this example is just showing the usage of "DiscoveryRule_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 HealthModelResource created on azure
+ // for more information of creating HealthModelResource, please refer to the document of HealthModelResource
+ string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ string resourceGroupName = "myResourceGroup";
+ string healthModelName = "myHealthModel";
+ ResourceIdentifier healthModelResourceId = HealthModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName);
+ HealthModelResource healthModel = client.GetHealthModelResource(healthModelResourceId);
+
+ // get the collection of this DiscoveryRuleResource
+ DiscoveryRuleCollection collection = healthModel.GetDiscoveryRules();
+
+ // invoke the operation
+ string discoveryRuleName = "myDiscoveryRule";
+ NullableResponse response = await collection.GetIfExistsAsync(discoveryRuleName);
+ DiscoveryRuleResource 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
+ DiscoveryRuleData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+ }
+ }
+}
diff --git a/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Generated/Samples/Sample_DiscoveryRuleResource.cs b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Generated/Samples/Sample_DiscoveryRuleResource.cs
new file mode 100644
index 000000000000..c5b82d3024f7
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Generated/Samples/Sample_DiscoveryRuleResource.cs
@@ -0,0 +1,116 @@
+// 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.CloudHealth.Models;
+using NUnit.Framework;
+
+namespace Azure.ResourceManager.CloudHealth.Samples
+{
+ public partial class Sample_DiscoveryRuleResource
+ {
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Get_DiscoveryRulesGet()
+ {
+ // Generated from example definition: 2023-10-01-preview/DiscoveryRules_Get.json
+ // this example is just showing the usage of "DiscoveryRule_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 DiscoveryRuleResource created on azure
+ // for more information of creating DiscoveryRuleResource, please refer to the document of DiscoveryRuleResource
+ string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ string resourceGroupName = "myResourceGroup";
+ string healthModelName = "myHealthModel";
+ string discoveryRuleName = "myDiscoveryRule";
+ ResourceIdentifier discoveryRuleResourceId = DiscoveryRuleResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName, discoveryRuleName);
+ DiscoveryRuleResource discoveryRule = client.GetDiscoveryRuleResource(discoveryRuleResourceId);
+
+ // invoke the operation
+ DiscoveryRuleResource result = await discoveryRule.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
+ DiscoveryRuleData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Delete_DiscoveryRulesDelete()
+ {
+ // Generated from example definition: 2023-10-01-preview/DiscoveryRules_Delete.json
+ // this example is just showing the usage of "DiscoveryRule_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 DiscoveryRuleResource created on azure
+ // for more information of creating DiscoveryRuleResource, please refer to the document of DiscoveryRuleResource
+ string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ string resourceGroupName = "my-resource-group";
+ string healthModelName = "my-health-model";
+ string discoveryRuleName = "my-discovery-rule";
+ ResourceIdentifier discoveryRuleResourceId = DiscoveryRuleResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName, discoveryRuleName);
+ DiscoveryRuleResource discoveryRule = client.GetDiscoveryRuleResource(discoveryRuleResourceId);
+
+ // invoke the operation
+ await discoveryRule.DeleteAsync(WaitUntil.Completed);
+
+ Console.WriteLine("Succeeded");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Update_DiscoveryRulesCreateOrUpdate()
+ {
+ // Generated from example definition: 2023-10-01-preview/DiscoveryRules_CreateOrUpdate.json
+ // this example is just showing the usage of "DiscoveryRule_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 DiscoveryRuleResource created on azure
+ // for more information of creating DiscoveryRuleResource, please refer to the document of DiscoveryRuleResource
+ string subscriptionId = "00000000-0000-0000-0000-000000000000";
+ string resourceGroupName = "myResourceGroup";
+ string healthModelName = "myHealthModel";
+ string discoveryRuleName = "myDiscoveryRule";
+ ResourceIdentifier discoveryRuleResourceId = DiscoveryRuleResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName, discoveryRuleName);
+ DiscoveryRuleResource discoveryRule = client.GetDiscoveryRuleResource(discoveryRuleResourceId);
+
+ // invoke the operation
+ DiscoveryRuleData data = new DiscoveryRuleData
+ {
+ Properties = new DiscoveryRuleProperties("resources | where subscriptionId == '7ddfffd7-9b32-40df-1234-828cbd55d6f4' | where resourceGroup == 'my-rg'", "authSetting1", DiscoveryRuleRelationshipDiscoveryBehavior.Enabled, DiscoveryRuleRecommendedSignalsBehavior.Enabled, null)
+ {
+ DisplayName = "myDisplayName",
+ },
+ };
+ ArmOperation lro = await discoveryRule.UpdateAsync(WaitUntil.Completed, data);
+ DiscoveryRuleResource 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
+ DiscoveryRuleData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+ }
+}
diff --git a/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Generated/Samples/Sample_EntityCollection.cs b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Generated/Samples/Sample_EntityCollection.cs
new file mode 100644
index 000000000000..1de5f1aec47a
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Generated/Samples/Sample_EntityCollection.cs
@@ -0,0 +1,243 @@
+// 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.CloudHealth.Models;
+using NUnit.Framework;
+
+namespace Azure.ResourceManager.CloudHealth.Samples
+{
+ public partial class Sample_EntityCollection
+ {
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task CreateOrUpdate_EntitiesCreateOrUpdate()
+ {
+ // Generated from example definition: 2023-10-01-preview/Entities_CreateOrUpdate.json
+ // this example is just showing the usage of "Entity_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 HealthModelResource created on azure
+ // for more information of creating HealthModelResource, please refer to the document of HealthModelResource
+ string subscriptionId = "4980D7D5-4E07-47AD-AD34-E76C6BC9F061";
+ string resourceGroupName = "rgopenapi";
+ string healthModelName = "myHealthModel";
+ ResourceIdentifier healthModelResourceId = HealthModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName);
+ HealthModelResource healthModel = client.GetHealthModelResource(healthModelResourceId);
+
+ // get the collection of this EntityResource
+ EntityCollection collection = healthModel.GetEntities();
+
+ // invoke the operation
+ string entityName = "uszrxbdkxesdrxhmagmzywebgbjj";
+ EntityData data = new EntityData
+ {
+ Properties = new EntityProperties
+ {
+ DisplayName = "My entity",
+ CanvasPosition = new EntityCoordinates(14F, 13F),
+ Icon = new IconDefinition("Custom")
+ {
+ CustomData = "rcitntvapruccrhtxmkqjphbxunkz",
+ },
+ HealthObjective = 62F,
+ Impact = EntityImpact.Standard,
+ Labels =
+{
+["key1376"] = "ixfvzsfnpvkkbrce"
+},
+ Signals = new SignalGroup
+ {
+ AzureResource = new AzureResourceSignalGroup("B3P1X3e-FZtZ-4Ak-2VLHGQ-4m4-05DE-XNW5zW3P-46XY-DC3SSX", new ResourceIdentifier("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/vm1"))
+ {
+ SignalAssignments = { new SignalAssignment(new string[] { "sigdef1" }) },
+ },
+ AzureLogAnalytics = new LogAnalyticsSignalGroup("B3P1X3e-FZtZ-4Ak-2VLHGQ-4m4-05DE-XNW5zW3P-46XY-DC3SSX", new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.OperationalInsights/workspaces/myworkspace"))
+ {
+ SignalAssignments = { new SignalAssignment(new string[] { "B3P1X3e-FZtZ-4Ak-2VLHGQ-4m4-05DE-XNW5zW3P-46XY-DC3SSX" }) },
+ },
+ AzureMonitorWorkspace = new AzureMonitorWorkspaceSignalGroup("B3P1X3e-FZtZ-4Ak-2VLHGQ-4m4-05DE-XNW5zW3P-46XY-DC3SSX", new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.OperationalInsights/workspaces/myworkspace"))
+ {
+ SignalAssignments = { new SignalAssignment(new string[] { "sigdef2" }), new SignalAssignment(new string[] { "sigdef3" }) },
+ },
+ Dependencies = new DependenciesSignalGroup(DependenciesAggregationType.WorstOf),
+ },
+ Alerts = new EntityAlerts
+ {
+ Unhealthy = new AlertConfiguration(AlertSeverity.Sev1)
+ {
+ Description = "Alert description",
+ ActionGroupIds = { new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Insights/actionGroups/myactiongroup") },
+ },
+ Degraded = new AlertConfiguration(AlertSeverity.Sev4)
+ {
+ Description = "Alert description",
+ ActionGroupIds = { new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Insights/actionGroups/myactiongroup") },
+ },
+ },
+ },
+ };
+ ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, entityName, data);
+ EntityResource 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
+ EntityData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Get_EntitiesGet()
+ {
+ // Generated from example definition: 2023-10-01-preview/Entities_Get.json
+ // this example is just showing the usage of "Entity_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 HealthModelResource created on azure
+ // for more information of creating HealthModelResource, please refer to the document of HealthModelResource
+ string subscriptionId = "4980D7D5-4E07-47AD-AD34-E76C6BC9F061";
+ string resourceGroupName = "rgopenapi";
+ string healthModelName = "myHealthModel";
+ ResourceIdentifier healthModelResourceId = HealthModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName);
+ HealthModelResource healthModel = client.GetHealthModelResource(healthModelResourceId);
+
+ // get the collection of this EntityResource
+ EntityCollection collection = healthModel.GetEntities();
+
+ // invoke the operation
+ string entityName = "entity1";
+ EntityResource result = await collection.GetAsync(entityName);
+
+ // 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
+ EntityData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task GetAll_EntitiesListByHealthModel()
+ {
+ // Generated from example definition: 2023-10-01-preview/Entities_ListByHealthModel.json
+ // this example is just showing the usage of "Entity_ListByHealthModel" 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 HealthModelResource created on azure
+ // for more information of creating HealthModelResource, please refer to the document of HealthModelResource
+ string subscriptionId = "4980D7D5-4E07-47AD-AD34-E76C6BC9F061";
+ string resourceGroupName = "rgopenapi";
+ string healthModelName = "gPWT6GP85xRV248L7LhNRTD--2Yc73wu-5Qk-0tS";
+ ResourceIdentifier healthModelResourceId = HealthModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName);
+ HealthModelResource healthModel = client.GetHealthModelResource(healthModelResourceId);
+
+ // get the collection of this EntityResource
+ EntityCollection collection = healthModel.GetEntities();
+
+ // invoke the operation and iterate over the result
+ await foreach (EntityResource 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
+ EntityData resourceData = item.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ Console.WriteLine("Succeeded");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Exists_EntitiesGet()
+ {
+ // Generated from example definition: 2023-10-01-preview/Entities_Get.json
+ // this example is just showing the usage of "Entity_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 HealthModelResource created on azure
+ // for more information of creating HealthModelResource, please refer to the document of HealthModelResource
+ string subscriptionId = "4980D7D5-4E07-47AD-AD34-E76C6BC9F061";
+ string resourceGroupName = "rgopenapi";
+ string healthModelName = "myHealthModel";
+ ResourceIdentifier healthModelResourceId = HealthModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName);
+ HealthModelResource healthModel = client.GetHealthModelResource(healthModelResourceId);
+
+ // get the collection of this EntityResource
+ EntityCollection collection = healthModel.GetEntities();
+
+ // invoke the operation
+ string entityName = "entity1";
+ bool result = await collection.ExistsAsync(entityName);
+
+ Console.WriteLine($"Succeeded: {result}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task GetIfExists_EntitiesGet()
+ {
+ // Generated from example definition: 2023-10-01-preview/Entities_Get.json
+ // this example is just showing the usage of "Entity_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 HealthModelResource created on azure
+ // for more information of creating HealthModelResource, please refer to the document of HealthModelResource
+ string subscriptionId = "4980D7D5-4E07-47AD-AD34-E76C6BC9F061";
+ string resourceGroupName = "rgopenapi";
+ string healthModelName = "myHealthModel";
+ ResourceIdentifier healthModelResourceId = HealthModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName);
+ HealthModelResource healthModel = client.GetHealthModelResource(healthModelResourceId);
+
+ // get the collection of this EntityResource
+ EntityCollection collection = healthModel.GetEntities();
+
+ // invoke the operation
+ string entityName = "entity1";
+ NullableResponse response = await collection.GetIfExistsAsync(entityName);
+ EntityResource 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
+ EntityData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+ }
+ }
+}
diff --git a/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Generated/Samples/Sample_EntityResource.cs b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Generated/Samples/Sample_EntityResource.cs
new file mode 100644
index 000000000000..0c2e7ccda985
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Generated/Samples/Sample_EntityResource.cs
@@ -0,0 +1,156 @@
+// 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.CloudHealth.Models;
+using NUnit.Framework;
+
+namespace Azure.ResourceManager.CloudHealth.Samples
+{
+ public partial class Sample_EntityResource
+ {
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Get_EntitiesGet()
+ {
+ // Generated from example definition: 2023-10-01-preview/Entities_Get.json
+ // this example is just showing the usage of "Entity_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 EntityResource created on azure
+ // for more information of creating EntityResource, please refer to the document of EntityResource
+ string subscriptionId = "4980D7D5-4E07-47AD-AD34-E76C6BC9F061";
+ string resourceGroupName = "rgopenapi";
+ string healthModelName = "myHealthModel";
+ string entityName = "entity1";
+ ResourceIdentifier entityResourceId = EntityResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName, entityName);
+ EntityResource entity = client.GetEntityResource(entityResourceId);
+
+ // invoke the operation
+ EntityResource result = await entity.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
+ EntityData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Delete_EntitiesDelete()
+ {
+ // Generated from example definition: 2023-10-01-preview/Entities_Delete.json
+ // this example is just showing the usage of "Entity_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 EntityResource created on azure
+ // for more information of creating EntityResource, please refer to the document of EntityResource
+ string subscriptionId = "4980D7D5-4E07-47AD-AD34-E76C6BC9F061";
+ string resourceGroupName = "rgopenapi";
+ string healthModelName = "model1";
+ string entityName = "U4VTRFlUkm9kR6H23-c-6U-XHq7n";
+ ResourceIdentifier entityResourceId = EntityResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName, entityName);
+ EntityResource entity = client.GetEntityResource(entityResourceId);
+
+ // invoke the operation
+ await entity.DeleteAsync(WaitUntil.Completed);
+
+ Console.WriteLine("Succeeded");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Update_EntitiesCreateOrUpdate()
+ {
+ // Generated from example definition: 2023-10-01-preview/Entities_CreateOrUpdate.json
+ // this example is just showing the usage of "Entity_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 EntityResource created on azure
+ // for more information of creating EntityResource, please refer to the document of EntityResource
+ string subscriptionId = "4980D7D5-4E07-47AD-AD34-E76C6BC9F061";
+ string resourceGroupName = "rgopenapi";
+ string healthModelName = "myHealthModel";
+ string entityName = "uszrxbdkxesdrxhmagmzywebgbjj";
+ ResourceIdentifier entityResourceId = EntityResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName, entityName);
+ EntityResource entity = client.GetEntityResource(entityResourceId);
+
+ // invoke the operation
+ EntityData data = new EntityData
+ {
+ Properties = new EntityProperties
+ {
+ DisplayName = "My entity",
+ CanvasPosition = new EntityCoordinates(14F, 13F),
+ Icon = new IconDefinition("Custom")
+ {
+ CustomData = "rcitntvapruccrhtxmkqjphbxunkz",
+ },
+ HealthObjective = 62F,
+ Impact = EntityImpact.Standard,
+ Labels =
+{
+["key1376"] = "ixfvzsfnpvkkbrce"
+},
+ Signals = new SignalGroup
+ {
+ AzureResource = new AzureResourceSignalGroup("B3P1X3e-FZtZ-4Ak-2VLHGQ-4m4-05DE-XNW5zW3P-46XY-DC3SSX", new ResourceIdentifier("/subscriptions/12345678-1234-1234-1234-123456789012/resourceGroups/rg1/providers/Microsoft.Compute/virtualMachines/vm1"))
+ {
+ SignalAssignments = { new SignalAssignment(new string[] { "sigdef1" }) },
+ },
+ AzureLogAnalytics = new LogAnalyticsSignalGroup("B3P1X3e-FZtZ-4Ak-2VLHGQ-4m4-05DE-XNW5zW3P-46XY-DC3SSX", new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.OperationalInsights/workspaces/myworkspace"))
+ {
+ SignalAssignments = { new SignalAssignment(new string[] { "B3P1X3e-FZtZ-4Ak-2VLHGQ-4m4-05DE-XNW5zW3P-46XY-DC3SSX" }) },
+ },
+ AzureMonitorWorkspace = new AzureMonitorWorkspaceSignalGroup("B3P1X3e-FZtZ-4Ak-2VLHGQ-4m4-05DE-XNW5zW3P-46XY-DC3SSX", new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.OperationalInsights/workspaces/myworkspace"))
+ {
+ SignalAssignments = { new SignalAssignment(new string[] { "sigdef2" }), new SignalAssignment(new string[] { "sigdef3" }) },
+ },
+ Dependencies = new DependenciesSignalGroup(DependenciesAggregationType.WorstOf),
+ },
+ Alerts = new EntityAlerts
+ {
+ Unhealthy = new AlertConfiguration(AlertSeverity.Sev1)
+ {
+ Description = "Alert description",
+ ActionGroupIds = { new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Insights/actionGroups/myactiongroup") },
+ },
+ Degraded = new AlertConfiguration(AlertSeverity.Sev4)
+ {
+ Description = "Alert description",
+ ActionGroupIds = { new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Insights/actionGroups/myactiongroup") },
+ },
+ },
+ },
+ };
+ ArmOperation lro = await entity.UpdateAsync(WaitUntil.Completed, data);
+ EntityResource 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
+ EntityData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+ }
+}
diff --git a/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Generated/Samples/Sample_HealthModelCollection.cs b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Generated/Samples/Sample_HealthModelCollection.cs
new file mode 100644
index 000000000000..dba037191d3b
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Generated/Samples/Sample_HealthModelCollection.cs
@@ -0,0 +1,214 @@
+// 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.CloudHealth.Models;
+using Azure.ResourceManager.Models;
+using Azure.ResourceManager.Resources;
+using NUnit.Framework;
+
+namespace Azure.ResourceManager.CloudHealth.Samples
+{
+ public partial class Sample_HealthModelCollection
+ {
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task CreateOrUpdate_HealthModelsCreate()
+ {
+ // Generated from example definition: 2023-10-01-preview/HealthModels_Create.json
+ // this example is just showing the usage of "HealthModel_Create" 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 = "4980D7D5-4E07-47AD-AD34-E76C6BC9F061";
+ string resourceGroupName = "rgopenapi";
+ ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
+ ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
+
+ // get the collection of this HealthModelResource
+ HealthModelCollection collection = resourceGroupResource.GetHealthModels();
+
+ // invoke the operation
+ string healthModelName = "model1";
+ HealthModelData data = new HealthModelData(new AzureLocation("eastus2"))
+ {
+ Properties = new HealthModelProperties
+ {
+ Discovery = new ModelDiscoverySettings("/providers/Microsoft.Management/serviceGroups/myServiceGroup", DiscoveryRuleRecommendedSignalsBehavior.Enabled)
+ {
+ Identity = "SystemAssigned",
+ },
+ },
+ Identity = new ManagedServiceIdentity("SystemAssigned, UserAssigned")
+ {
+ UserAssignedIdentities =
+{
+[new ResourceIdentifier("/subscriptions/4980D7D5-4E07-47AD-AD34-E76C6BC9F061/resourceGroups/rgopenapi/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ua1")] = new UserAssignedIdentity()
+},
+ },
+ Tags =
+{
+["key2961"] = "hbljozzkqrpcthsjtfkyozpwyx"
+},
+ };
+ ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, healthModelName, data);
+ HealthModelResource 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
+ HealthModelData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Get_HealthModelsGet()
+ {
+ // Generated from example definition: 2023-10-01-preview/HealthModels_Get.json
+ // this example is just showing the usage of "HealthModel_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 = "4980D7D5-4E07-47AD-AD34-E76C6BC9F061";
+ string resourceGroupName = "rgopenapi";
+ ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
+ ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
+
+ // get the collection of this HealthModelResource
+ HealthModelCollection collection = resourceGroupResource.GetHealthModels();
+
+ // invoke the operation
+ string healthModelName = "myHealthModel";
+ HealthModelResource result = await collection.GetAsync(healthModelName);
+
+ // 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
+ HealthModelData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task GetAll_HealthModelsListByResourceGroup()
+ {
+ // Generated from example definition: 2023-10-01-preview/HealthModels_ListByResourceGroup.json
+ // this example is just showing the usage of "HealthModel_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 = "4980D7D5-4E07-47AD-AD34-E76C6BC9F061";
+ string resourceGroupName = "rgopenapi";
+ ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
+ ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
+
+ // get the collection of this HealthModelResource
+ HealthModelCollection collection = resourceGroupResource.GetHealthModels();
+
+ // invoke the operation and iterate over the result
+ await foreach (HealthModelResource 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
+ HealthModelData resourceData = item.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ Console.WriteLine("Succeeded");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Exists_HealthModelsGet()
+ {
+ // Generated from example definition: 2023-10-01-preview/HealthModels_Get.json
+ // this example is just showing the usage of "HealthModel_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 = "4980D7D5-4E07-47AD-AD34-E76C6BC9F061";
+ string resourceGroupName = "rgopenapi";
+ ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
+ ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
+
+ // get the collection of this HealthModelResource
+ HealthModelCollection collection = resourceGroupResource.GetHealthModels();
+
+ // invoke the operation
+ string healthModelName = "myHealthModel";
+ bool result = await collection.ExistsAsync(healthModelName);
+
+ Console.WriteLine($"Succeeded: {result}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task GetIfExists_HealthModelsGet()
+ {
+ // Generated from example definition: 2023-10-01-preview/HealthModels_Get.json
+ // this example is just showing the usage of "HealthModel_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 = "4980D7D5-4E07-47AD-AD34-E76C6BC9F061";
+ string resourceGroupName = "rgopenapi";
+ ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName);
+ ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId);
+
+ // get the collection of this HealthModelResource
+ HealthModelCollection collection = resourceGroupResource.GetHealthModels();
+
+ // invoke the operation
+ string healthModelName = "myHealthModel";
+ NullableResponse response = await collection.GetIfExistsAsync(healthModelName);
+ HealthModelResource 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
+ HealthModelData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+ }
+ }
+}
diff --git a/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Generated/Samples/Sample_HealthModelResource.cs b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Generated/Samples/Sample_HealthModelResource.cs
new file mode 100644
index 000000000000..df600b979c88
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Generated/Samples/Sample_HealthModelResource.cs
@@ -0,0 +1,121 @@
+// 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.CloudHealth.Models;
+using Azure.ResourceManager.Models;
+using NUnit.Framework;
+
+namespace Azure.ResourceManager.CloudHealth.Samples
+{
+ public partial class Sample_HealthModelResource
+ {
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Get_HealthModelsGet()
+ {
+ // Generated from example definition: 2023-10-01-preview/HealthModels_Get.json
+ // this example is just showing the usage of "HealthModel_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 HealthModelResource created on azure
+ // for more information of creating HealthModelResource, please refer to the document of HealthModelResource
+ string subscriptionId = "4980D7D5-4E07-47AD-AD34-E76C6BC9F061";
+ string resourceGroupName = "rgopenapi";
+ string healthModelName = "myHealthModel";
+ ResourceIdentifier healthModelResourceId = HealthModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName);
+ HealthModelResource healthModel = client.GetHealthModelResource(healthModelResourceId);
+
+ // invoke the operation
+ HealthModelResource result = await healthModel.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
+ HealthModelData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Delete_HealthModelsDelete()
+ {
+ // Generated from example definition: 2023-10-01-preview/HealthModels_Delete.json
+ // this example is just showing the usage of "HealthModel_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 HealthModelResource created on azure
+ // for more information of creating HealthModelResource, please refer to the document of HealthModelResource
+ string subscriptionId = "4980D7D5-4E07-47AD-AD34-E76C6BC9F061";
+ string resourceGroupName = "rgopenapi";
+ string healthModelName = "model1";
+ ResourceIdentifier healthModelResourceId = HealthModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName);
+ HealthModelResource healthModel = client.GetHealthModelResource(healthModelResourceId);
+
+ // invoke the operation
+ await healthModel.DeleteAsync(WaitUntil.Completed);
+
+ Console.WriteLine("Succeeded");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Update_HealthModelsUpdate()
+ {
+ // Generated from example definition: 2023-10-01-preview/HealthModels_Update.json
+ // this example is just showing the usage of "HealthModel_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 HealthModelResource created on azure
+ // for more information of creating HealthModelResource, please refer to the document of HealthModelResource
+ string subscriptionId = "4980D7D5-4E07-47AD-AD34-E76C6BC9F061";
+ string resourceGroupName = "rgopenapi";
+ string healthModelName = "model1";
+ ResourceIdentifier healthModelResourceId = HealthModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName);
+ HealthModelResource healthModel = client.GetHealthModelResource(healthModelResourceId);
+
+ // invoke the operation
+ HealthModelPatch patch = new HealthModelPatch
+ {
+ Identity = new ManagedServiceIdentity("SystemAssigned, UserAssigned")
+ {
+ UserAssignedIdentities =
+{
+[new ResourceIdentifier("/subscriptions/4980D7D5-4E07-47AD-AD34-E76C6BC9F061/resourceGroups/rgopenapi/providers/Microsoft.ManagedIdentity/userAssignedIdentities/ua1")] = new UserAssignedIdentity()
+},
+ },
+ Tags =
+{
+["key21"] = "menfkmseplchh"
+},
+ };
+ ArmOperation lro = await healthModel.UpdateAsync(WaitUntil.Completed, patch);
+ HealthModelResource 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
+ HealthModelData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+ }
+}
diff --git a/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Generated/Samples/Sample_RelationshipCollection.cs b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Generated/Samples/Sample_RelationshipCollection.cs
new file mode 100644
index 000000000000..bcc03911390f
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Generated/Samples/Sample_RelationshipCollection.cs
@@ -0,0 +1,207 @@
+// 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.CloudHealth.Models;
+using NUnit.Framework;
+
+namespace Azure.ResourceManager.CloudHealth.Samples
+{
+ public partial class Sample_RelationshipCollection
+ {
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task CreateOrUpdate_RelationshipsCreateOrUpdate()
+ {
+ // Generated from example definition: 2023-10-01-preview/Relationships_CreateOrUpdate.json
+ // this example is just showing the usage of "Relationship_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 HealthModelResource created on azure
+ // for more information of creating HealthModelResource, please refer to the document of HealthModelResource
+ string subscriptionId = "4980D7D5-4E07-47AD-AD34-E76C6BC9F061";
+ string resourceGroupName = "rgopenapi";
+ string healthModelName = "model1";
+ ResourceIdentifier healthModelResourceId = HealthModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName);
+ HealthModelResource healthModel = client.GetHealthModelResource(healthModelResourceId);
+
+ // get the collection of this RelationshipResource
+ RelationshipCollection collection = healthModel.GetRelationships();
+
+ // invoke the operation
+ string relationshipName = "rel1";
+ RelationshipData data = new RelationshipData
+ {
+ Properties = new RelationshipProperties("Entity1", "Entity2")
+ {
+ DisplayName = "My relationship",
+ Labels =
+{
+["key9681"] = "ixfvzsfnpvkkbrce"
+},
+ },
+ };
+ ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, relationshipName, data);
+ RelationshipResource 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
+ RelationshipData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Get_RelationshipsGet()
+ {
+ // Generated from example definition: 2023-10-01-preview/Relationships_Get.json
+ // this example is just showing the usage of "Relationship_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 HealthModelResource created on azure
+ // for more information of creating HealthModelResource, please refer to the document of HealthModelResource
+ string subscriptionId = "4980D7D5-4E07-47AD-AD34-E76C6BC9F061";
+ string resourceGroupName = "rgopenapi";
+ string healthModelName = "myHealthModel";
+ ResourceIdentifier healthModelResourceId = HealthModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName);
+ HealthModelResource healthModel = client.GetHealthModelResource(healthModelResourceId);
+
+ // get the collection of this RelationshipResource
+ RelationshipCollection collection = healthModel.GetRelationships();
+
+ // invoke the operation
+ string relationshipName = "Ue-21-F3M12V3w-13x18F8H-7HOk--kq6tP-HB";
+ RelationshipResource result = await collection.GetAsync(relationshipName);
+
+ // 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
+ RelationshipData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task GetAll_RelationshipsListByHealthModel()
+ {
+ // Generated from example definition: 2023-10-01-preview/Relationships_ListByHealthModel.json
+ // this example is just showing the usage of "Relationship_ListByHealthModel" 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 HealthModelResource created on azure
+ // for more information of creating HealthModelResource, please refer to the document of HealthModelResource
+ string subscriptionId = "4980D7D5-4E07-47AD-AD34-E76C6BC9F061";
+ string resourceGroupName = "rgopenapi";
+ string healthModelName = "model1";
+ ResourceIdentifier healthModelResourceId = HealthModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName);
+ HealthModelResource healthModel = client.GetHealthModelResource(healthModelResourceId);
+
+ // get the collection of this RelationshipResource
+ RelationshipCollection collection = healthModel.GetRelationships();
+
+ // invoke the operation and iterate over the result
+ await foreach (RelationshipResource 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
+ RelationshipData resourceData = item.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ Console.WriteLine("Succeeded");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Exists_RelationshipsGet()
+ {
+ // Generated from example definition: 2023-10-01-preview/Relationships_Get.json
+ // this example is just showing the usage of "Relationship_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 HealthModelResource created on azure
+ // for more information of creating HealthModelResource, please refer to the document of HealthModelResource
+ string subscriptionId = "4980D7D5-4E07-47AD-AD34-E76C6BC9F061";
+ string resourceGroupName = "rgopenapi";
+ string healthModelName = "myHealthModel";
+ ResourceIdentifier healthModelResourceId = HealthModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName);
+ HealthModelResource healthModel = client.GetHealthModelResource(healthModelResourceId);
+
+ // get the collection of this RelationshipResource
+ RelationshipCollection collection = healthModel.GetRelationships();
+
+ // invoke the operation
+ string relationshipName = "Ue-21-F3M12V3w-13x18F8H-7HOk--kq6tP-HB";
+ bool result = await collection.ExistsAsync(relationshipName);
+
+ Console.WriteLine($"Succeeded: {result}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task GetIfExists_RelationshipsGet()
+ {
+ // Generated from example definition: 2023-10-01-preview/Relationships_Get.json
+ // this example is just showing the usage of "Relationship_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 HealthModelResource created on azure
+ // for more information of creating HealthModelResource, please refer to the document of HealthModelResource
+ string subscriptionId = "4980D7D5-4E07-47AD-AD34-E76C6BC9F061";
+ string resourceGroupName = "rgopenapi";
+ string healthModelName = "myHealthModel";
+ ResourceIdentifier healthModelResourceId = HealthModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName);
+ HealthModelResource healthModel = client.GetHealthModelResource(healthModelResourceId);
+
+ // get the collection of this RelationshipResource
+ RelationshipCollection collection = healthModel.GetRelationships();
+
+ // invoke the operation
+ string relationshipName = "Ue-21-F3M12V3w-13x18F8H-7HOk--kq6tP-HB";
+ NullableResponse response = await collection.GetIfExistsAsync(relationshipName);
+ RelationshipResource 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
+ RelationshipData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+ }
+ }
+}
diff --git a/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Generated/Samples/Sample_RelationshipResource.cs b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Generated/Samples/Sample_RelationshipResource.cs
new file mode 100644
index 000000000000..fafc3c58d1a5
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Generated/Samples/Sample_RelationshipResource.cs
@@ -0,0 +1,120 @@
+// 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.CloudHealth.Models;
+using NUnit.Framework;
+
+namespace Azure.ResourceManager.CloudHealth.Samples
+{
+ public partial class Sample_RelationshipResource
+ {
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Get_RelationshipsGet()
+ {
+ // Generated from example definition: 2023-10-01-preview/Relationships_Get.json
+ // this example is just showing the usage of "Relationship_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 RelationshipResource created on azure
+ // for more information of creating RelationshipResource, please refer to the document of RelationshipResource
+ string subscriptionId = "4980D7D5-4E07-47AD-AD34-E76C6BC9F061";
+ string resourceGroupName = "rgopenapi";
+ string healthModelName = "myHealthModel";
+ string relationshipName = "Ue-21-F3M12V3w-13x18F8H-7HOk--kq6tP-HB";
+ ResourceIdentifier relationshipResourceId = RelationshipResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName, relationshipName);
+ RelationshipResource relationship = client.GetRelationshipResource(relationshipResourceId);
+
+ // invoke the operation
+ RelationshipResource result = await relationship.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
+ RelationshipData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Delete_RelationshipsDelete()
+ {
+ // Generated from example definition: 2023-10-01-preview/Relationships_Delete.json
+ // this example is just showing the usage of "Relationship_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 RelationshipResource created on azure
+ // for more information of creating RelationshipResource, please refer to the document of RelationshipResource
+ string subscriptionId = "4980D7D5-4E07-47AD-AD34-E76C6BC9F061";
+ string resourceGroupName = "rgopenapi";
+ string healthModelName = "model1";
+ string relationshipName = "rel1";
+ ResourceIdentifier relationshipResourceId = RelationshipResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName, relationshipName);
+ RelationshipResource relationship = client.GetRelationshipResource(relationshipResourceId);
+
+ // invoke the operation
+ await relationship.DeleteAsync(WaitUntil.Completed);
+
+ Console.WriteLine("Succeeded");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Update_RelationshipsCreateOrUpdate()
+ {
+ // Generated from example definition: 2023-10-01-preview/Relationships_CreateOrUpdate.json
+ // this example is just showing the usage of "Relationship_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 RelationshipResource created on azure
+ // for more information of creating RelationshipResource, please refer to the document of RelationshipResource
+ string subscriptionId = "4980D7D5-4E07-47AD-AD34-E76C6BC9F061";
+ string resourceGroupName = "rgopenapi";
+ string healthModelName = "model1";
+ string relationshipName = "rel1";
+ ResourceIdentifier relationshipResourceId = RelationshipResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName, relationshipName);
+ RelationshipResource relationship = client.GetRelationshipResource(relationshipResourceId);
+
+ // invoke the operation
+ RelationshipData data = new RelationshipData
+ {
+ Properties = new RelationshipProperties("Entity1", "Entity2")
+ {
+ DisplayName = "My relationship",
+ Labels =
+{
+["key9681"] = "ixfvzsfnpvkkbrce"
+},
+ },
+ };
+ ArmOperation lro = await relationship.UpdateAsync(WaitUntil.Completed, data);
+ RelationshipResource 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
+ RelationshipData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+ }
+}
diff --git a/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Generated/Samples/Sample_SignalDefinitionCollection.cs b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Generated/Samples/Sample_SignalDefinitionCollection.cs
new file mode 100644
index 000000000000..4a7bc7106e23
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Generated/Samples/Sample_SignalDefinitionCollection.cs
@@ -0,0 +1,215 @@
+// 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.CloudHealth.Models;
+using NUnit.Framework;
+
+namespace Azure.ResourceManager.CloudHealth.Samples
+{
+ public partial class Sample_SignalDefinitionCollection
+ {
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task CreateOrUpdate_SignalDefinitionsCreateOrUpdate()
+ {
+ // Generated from example definition: 2023-10-01-preview/SignalDefinitions_CreateOrUpdate.json
+ // this example is just showing the usage of "SignalDefinition_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 HealthModelResource created on azure
+ // for more information of creating HealthModelResource, please refer to the document of HealthModelResource
+ string subscriptionId = "4980D7D5-4E07-47AD-AD34-E76C6BC9F061";
+ string resourceGroupName = "rgopenapi";
+ string healthModelName = "myHealthModel";
+ ResourceIdentifier healthModelResourceId = HealthModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName);
+ HealthModelResource healthModel = client.GetHealthModelResource(healthModelResourceId);
+
+ // get the collection of this SignalDefinitionResource
+ SignalDefinitionCollection collection = healthModel.GetSignalDefinitions();
+
+ // invoke the operation
+ string signalDefinitionName = "sig1";
+ SignalDefinitionData data = new SignalDefinitionData
+ {
+ Properties = new ResourceMetricSignalDefinitionProperties(new EvaluationRule
+ {
+ DegradedRule = new ThresholdRule(SignalOperator.LowerThan, "65"),
+ UnhealthyRule = new ThresholdRule(SignalOperator.LowerThan, "60"),
+ }, "microsoft.compute/virtualMachines", "cpuusage", "PT1M", MetricAggregationType.None)
+ {
+ Dimension = "nodename",
+ DimensionFilter = "node1",
+ DisplayName = "cpu usage",
+ RefreshInterval = RefreshInterval.PT1M,
+ Labels =
+{
+["key4788"] = "ixfvzsfnpvkkbrce"
+},
+ DataUnit = "byte",
+ },
+ };
+ ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, signalDefinitionName, data);
+ SignalDefinitionResource 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
+ SignalDefinitionData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Get_SignalDefinitionsGet()
+ {
+ // Generated from example definition: 2023-10-01-preview/SignalDefinitions_Get.json
+ // this example is just showing the usage of "SignalDefinition_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 HealthModelResource created on azure
+ // for more information of creating HealthModelResource, please refer to the document of HealthModelResource
+ string subscriptionId = "4980D7D5-4E07-47AD-AD34-E76C6BC9F061";
+ string resourceGroupName = "rgopenapi";
+ string healthModelName = "myHealthModel";
+ ResourceIdentifier healthModelResourceId = HealthModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName);
+ HealthModelResource healthModel = client.GetHealthModelResource(healthModelResourceId);
+
+ // get the collection of this SignalDefinitionResource
+ SignalDefinitionCollection collection = healthModel.GetSignalDefinitions();
+
+ // invoke the operation
+ string signalDefinitionName = "sig1";
+ SignalDefinitionResource result = await collection.GetAsync(signalDefinitionName);
+
+ // 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
+ SignalDefinitionData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task GetAll_SignalDefinitionsListByHealthModel()
+ {
+ // Generated from example definition: 2023-10-01-preview/SignalDefinitions_ListByHealthModel.json
+ // this example is just showing the usage of "SignalDefinition_ListByHealthModel" 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 HealthModelResource created on azure
+ // for more information of creating HealthModelResource, please refer to the document of HealthModelResource
+ string subscriptionId = "4980D7D5-4E07-47AD-AD34-E76C6BC9F061";
+ string resourceGroupName = "rgopenapi";
+ string healthModelName = "myHealthModel";
+ ResourceIdentifier healthModelResourceId = HealthModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName);
+ HealthModelResource healthModel = client.GetHealthModelResource(healthModelResourceId);
+
+ // get the collection of this SignalDefinitionResource
+ SignalDefinitionCollection collection = healthModel.GetSignalDefinitions();
+
+ // invoke the operation and iterate over the result
+ await foreach (SignalDefinitionResource 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
+ SignalDefinitionData resourceData = item.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ Console.WriteLine("Succeeded");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Exists_SignalDefinitionsGet()
+ {
+ // Generated from example definition: 2023-10-01-preview/SignalDefinitions_Get.json
+ // this example is just showing the usage of "SignalDefinition_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 HealthModelResource created on azure
+ // for more information of creating HealthModelResource, please refer to the document of HealthModelResource
+ string subscriptionId = "4980D7D5-4E07-47AD-AD34-E76C6BC9F061";
+ string resourceGroupName = "rgopenapi";
+ string healthModelName = "myHealthModel";
+ ResourceIdentifier healthModelResourceId = HealthModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName);
+ HealthModelResource healthModel = client.GetHealthModelResource(healthModelResourceId);
+
+ // get the collection of this SignalDefinitionResource
+ SignalDefinitionCollection collection = healthModel.GetSignalDefinitions();
+
+ // invoke the operation
+ string signalDefinitionName = "sig1";
+ bool result = await collection.ExistsAsync(signalDefinitionName);
+
+ Console.WriteLine($"Succeeded: {result}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task GetIfExists_SignalDefinitionsGet()
+ {
+ // Generated from example definition: 2023-10-01-preview/SignalDefinitions_Get.json
+ // this example is just showing the usage of "SignalDefinition_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 HealthModelResource created on azure
+ // for more information of creating HealthModelResource, please refer to the document of HealthModelResource
+ string subscriptionId = "4980D7D5-4E07-47AD-AD34-E76C6BC9F061";
+ string resourceGroupName = "rgopenapi";
+ string healthModelName = "myHealthModel";
+ ResourceIdentifier healthModelResourceId = HealthModelResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName);
+ HealthModelResource healthModel = client.GetHealthModelResource(healthModelResourceId);
+
+ // get the collection of this SignalDefinitionResource
+ SignalDefinitionCollection collection = healthModel.GetSignalDefinitions();
+
+ // invoke the operation
+ string signalDefinitionName = "sig1";
+ NullableResponse response = await collection.GetIfExistsAsync(signalDefinitionName);
+ SignalDefinitionResource 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
+ SignalDefinitionData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+ }
+ }
+}
diff --git a/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Generated/Samples/Sample_SignalDefinitionResource.cs b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Generated/Samples/Sample_SignalDefinitionResource.cs
new file mode 100644
index 000000000000..75d04684cff5
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Generated/Samples/Sample_SignalDefinitionResource.cs
@@ -0,0 +1,128 @@
+// 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.CloudHealth.Models;
+using NUnit.Framework;
+
+namespace Azure.ResourceManager.CloudHealth.Samples
+{
+ public partial class Sample_SignalDefinitionResource
+ {
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Get_SignalDefinitionsGet()
+ {
+ // Generated from example definition: 2023-10-01-preview/SignalDefinitions_Get.json
+ // this example is just showing the usage of "SignalDefinition_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 SignalDefinitionResource created on azure
+ // for more information of creating SignalDefinitionResource, please refer to the document of SignalDefinitionResource
+ string subscriptionId = "4980D7D5-4E07-47AD-AD34-E76C6BC9F061";
+ string resourceGroupName = "rgopenapi";
+ string healthModelName = "myHealthModel";
+ string signalDefinitionName = "sig1";
+ ResourceIdentifier signalDefinitionResourceId = SignalDefinitionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName, signalDefinitionName);
+ SignalDefinitionResource signalDefinition = client.GetSignalDefinitionResource(signalDefinitionResourceId);
+
+ // invoke the operation
+ SignalDefinitionResource result = await signalDefinition.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
+ SignalDefinitionData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Delete_SignalDefinitionsDelete()
+ {
+ // Generated from example definition: 2023-10-01-preview/SignalDefinitions_Delete.json
+ // this example is just showing the usage of "SignalDefinition_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 SignalDefinitionResource created on azure
+ // for more information of creating SignalDefinitionResource, please refer to the document of SignalDefinitionResource
+ string subscriptionId = "4980D7D5-4E07-47AD-AD34-E76C6BC9F061";
+ string resourceGroupName = "rgopenapi";
+ string healthModelName = "model1";
+ string signalDefinitionName = "sig";
+ ResourceIdentifier signalDefinitionResourceId = SignalDefinitionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName, signalDefinitionName);
+ SignalDefinitionResource signalDefinition = client.GetSignalDefinitionResource(signalDefinitionResourceId);
+
+ // invoke the operation
+ await signalDefinition.DeleteAsync(WaitUntil.Completed);
+
+ Console.WriteLine("Succeeded");
+ }
+
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task Update_SignalDefinitionsCreateOrUpdate()
+ {
+ // Generated from example definition: 2023-10-01-preview/SignalDefinitions_CreateOrUpdate.json
+ // this example is just showing the usage of "SignalDefinition_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 SignalDefinitionResource created on azure
+ // for more information of creating SignalDefinitionResource, please refer to the document of SignalDefinitionResource
+ string subscriptionId = "4980D7D5-4E07-47AD-AD34-E76C6BC9F061";
+ string resourceGroupName = "rgopenapi";
+ string healthModelName = "myHealthModel";
+ string signalDefinitionName = "sig1";
+ ResourceIdentifier signalDefinitionResourceId = SignalDefinitionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, healthModelName, signalDefinitionName);
+ SignalDefinitionResource signalDefinition = client.GetSignalDefinitionResource(signalDefinitionResourceId);
+
+ // invoke the operation
+ SignalDefinitionData data = new SignalDefinitionData
+ {
+ Properties = new ResourceMetricSignalDefinitionProperties(new EvaluationRule
+ {
+ DegradedRule = new ThresholdRule(SignalOperator.LowerThan, "65"),
+ UnhealthyRule = new ThresholdRule(SignalOperator.LowerThan, "60"),
+ }, "microsoft.compute/virtualMachines", "cpuusage", "PT1M", MetricAggregationType.None)
+ {
+ Dimension = "nodename",
+ DimensionFilter = "node1",
+ DisplayName = "cpu usage",
+ RefreshInterval = RefreshInterval.PT1M,
+ Labels =
+{
+["key4788"] = "ixfvzsfnpvkkbrce"
+},
+ DataUnit = "byte",
+ },
+ };
+ ArmOperation lro = await signalDefinition.UpdateAsync(WaitUntil.Completed, data);
+ SignalDefinitionResource 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
+ SignalDefinitionData resourceData = result.Data;
+ // for demo we just print out the id
+ Console.WriteLine($"Succeeded on id: {resourceData.Id}");
+ }
+ }
+}
diff --git a/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs
new file mode 100644
index 000000000000..871a8154c275
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs
@@ -0,0 +1,50 @@
+// 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.Resources;
+using NUnit.Framework;
+
+namespace Azure.ResourceManager.CloudHealth.Samples
+{
+ public partial class Sample_SubscriptionResourceExtensions
+ {
+ [Test]
+ [Ignore("Only validating compilation of examples")]
+ public async Task GetHealthModels_HealthModelsListBySubscription()
+ {
+ // Generated from example definition: 2023-10-01-preview/HealthModels_ListBySubscription.json
+ // this example is just showing the usage of "HealthModel_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 = "4980D7D5-4E07-47AD-AD34-E76C6BC9F061";
+ ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId);
+ SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId);
+
+ // invoke the operation and iterate over the result
+ await foreach (HealthModelResource item in subscriptionResource.GetHealthModelsAsync())
+ {
+ // 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
+ HealthModelData 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/cloudhealth/Azure.ResourceManager.CloudHealth/src/Azure.ResourceManager.CloudHealth.csproj b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Azure.ResourceManager.CloudHealth.csproj
new file mode 100644
index 000000000000..917693408c82
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Azure.ResourceManager.CloudHealth.csproj
@@ -0,0 +1,8 @@
+
+
+ Azure Resource Manager client SDK for Azure resource provider CloudHealth.
+ 1.0.0-beta.1
+ azure;management;arm;resource manager;cloudhealth
+ Azure.ResourceManager.CloudHealth
+
+
diff --git a/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/ArmCloudHealthModelFactory.cs b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/ArmCloudHealthModelFactory.cs
new file mode 100644
index 000000000000..0a4b6f57d6cf
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/ArmCloudHealthModelFactory.cs
@@ -0,0 +1,384 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Azure.Core;
+using Azure.ResourceManager.Models;
+
+namespace Azure.ResourceManager.CloudHealth.Models
+{
+ /// Model factory for models.
+ public static partial class ArmCloudHealthModelFactory
+ {
+ /// Initializes a new instance of .
+ /// The id.
+ /// The name.
+ /// The resourceType.
+ /// The systemData.
+ /// The tags.
+ /// The location.
+ /// The resource-specific properties for this resource.
+ /// The managed service identities assigned to this resource.
+ /// A new instance for mocking.
+ public static HealthModelData HealthModelData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, HealthModelProperties properties = null, ManagedServiceIdentity identity = null)
+ {
+ tags ??= new Dictionary();
+
+ return new HealthModelData(
+ id,
+ name,
+ resourceType,
+ systemData,
+ tags,
+ location,
+ properties,
+ identity,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The data plane endpoint for interacting with health data.
+ /// The status of the last operation.
+ /// Configure to automatically discover entities from a given scope, such as a Service Group. The discovered entities will be linked to the root entity of the health model.
+ /// A new instance for mocking.
+ public static HealthModelProperties HealthModelProperties(string dataplaneEndpoint = null, HealthModelProvisioningState? provisioningState = null, ModelDiscoverySettings discovery = null)
+ {
+ return new HealthModelProperties(dataplaneEndpoint, provisioningState, discovery, serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The id.
+ /// The name.
+ /// The resourceType.
+ /// The systemData.
+ ///
+ /// The resource-specific properties for this resource.
+ /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
+ /// The available derived classes include , and .
+ ///
+ /// A new instance for mocking.
+ public static SignalDefinitionData SignalDefinitionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, SignalDefinitionProperties properties = null)
+ {
+ return new SignalDefinitionData(
+ id,
+ name,
+ resourceType,
+ systemData,
+ properties,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The status of the last operation.
+ /// Display name.
+ /// Kind of the signal definition.
+ /// Interval in which the signal is being evaluated. Defaults to PT1M (1 minute).
+ /// Optional set of labels (key-value pairs).
+ /// Unit of the signal result (e.g. Bytes, MilliSeconds, Percent, Count)).
+ /// Evaluation rules for the signal definition.
+ /// Date when the signal definition was (soft-)deleted.
+ /// A new instance for mocking.
+ public static SignalDefinitionProperties SignalDefinitionProperties(HealthModelProvisioningState? provisioningState = null, string displayName = null, string signalKind = null, RefreshInterval? refreshInterval = null, IDictionary labels = null, string dataUnit = null, EvaluationRule evaluationRules = null, DateTimeOffset? deletedOn = null)
+ {
+ labels ??= new Dictionary();
+
+ return new UnknownSignalDefinitionProperties(
+ provisioningState,
+ displayName,
+ signalKind == null ? default : new SignalKind(signalKind),
+ refreshInterval,
+ labels,
+ dataUnit,
+ evaluationRules,
+ deletedOn,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The status of the last operation.
+ /// Display name.
+ /// Interval in which the signal is being evaluated. Defaults to PT1M (1 minute).
+ /// Optional set of labels (key-value pairs).
+ /// Unit of the signal result (e.g. Bytes, MilliSeconds, Percent, Count)).
+ /// Evaluation rules for the signal definition.
+ /// Date when the signal definition was (soft-)deleted.
+ /// Metric namespace.
+ /// Name of the metric.
+ /// Time range of signal. ISO duration format like PT10M.
+ /// Type of aggregation to apply to the metric.
+ /// Optional: Dimension to split by.
+ /// Optional: Dimension filter to apply to the dimension. Must only be set if also Dimension is set.
+ /// A new instance for mocking.
+ public static ResourceMetricSignalDefinitionProperties ResourceMetricSignalDefinitionProperties(HealthModelProvisioningState? provisioningState = null, string displayName = null, RefreshInterval? refreshInterval = null, IDictionary labels = null, string dataUnit = null, EvaluationRule evaluationRules = null, DateTimeOffset? deletedOn = null, string metricNamespace = null, string metricName = null, string timeGrain = null, MetricAggregationType aggregationType = default, string dimension = null, string dimensionFilter = null)
+ {
+ labels ??= new Dictionary();
+
+ return new ResourceMetricSignalDefinitionProperties(
+ provisioningState,
+ displayName,
+ SignalKind.AzureResourceMetric,
+ refreshInterval,
+ labels,
+ dataUnit,
+ evaluationRules,
+ deletedOn,
+ serializedAdditionalRawData: null,
+ metricNamespace,
+ metricName,
+ timeGrain,
+ aggregationType,
+ dimension,
+ dimensionFilter);
+ }
+
+ /// Initializes a new instance of .
+ /// The status of the last operation.
+ /// Display name.
+ /// Interval in which the signal is being evaluated. Defaults to PT1M (1 minute).
+ /// Optional set of labels (key-value pairs).
+ /// Unit of the signal result (e.g. Bytes, MilliSeconds, Percent, Count)).
+ /// Evaluation rules for the signal definition.
+ /// Date when the signal definition was (soft-)deleted.
+ /// Query text in KQL syntax.
+ /// Time range of signal. ISO duration format like PT10M. If not specified, the KQL query must define a time range.
+ /// Name of the column in the result set to evaluate against the thresholds. Defaults to the first column in the result set if not specified. The column must be numeric.
+ /// A new instance for mocking.
+ public static LogAnalyticsQuerySignalDefinitionProperties LogAnalyticsQuerySignalDefinitionProperties(HealthModelProvisioningState? provisioningState = null, string displayName = null, RefreshInterval? refreshInterval = null, IDictionary labels = null, string dataUnit = null, EvaluationRule evaluationRules = null, DateTimeOffset? deletedOn = null, string queryText = null, string timeGrain = null, string valueColumnName = null)
+ {
+ labels ??= new Dictionary();
+
+ return new LogAnalyticsQuerySignalDefinitionProperties(
+ provisioningState,
+ displayName,
+ SignalKind.LogAnalyticsQuery,
+ refreshInterval,
+ labels,
+ dataUnit,
+ evaluationRules,
+ deletedOn,
+ serializedAdditionalRawData: null,
+ queryText,
+ timeGrain,
+ valueColumnName);
+ }
+
+ /// Initializes a new instance of .
+ /// The status of the last operation.
+ /// Display name.
+ /// Interval in which the signal is being evaluated. Defaults to PT1M (1 minute).
+ /// Optional set of labels (key-value pairs).
+ /// Unit of the signal result (e.g. Bytes, MilliSeconds, Percent, Count)).
+ /// Evaluation rules for the signal definition.
+ /// Date when the signal definition was (soft-)deleted.
+ /// Query text in PromQL syntax.
+ /// Time range of signal. ISO duration format like PT10M.
+ /// A new instance for mocking.
+ public static PrometheusMetricsSignalDefinitionProperties PrometheusMetricsSignalDefinitionProperties(HealthModelProvisioningState? provisioningState = null, string displayName = null, RefreshInterval? refreshInterval = null, IDictionary labels = null, string dataUnit = null, EvaluationRule evaluationRules = null, DateTimeOffset? deletedOn = null, string queryText = null, string timeGrain = null)
+ {
+ labels ??= new Dictionary();
+
+ return new PrometheusMetricsSignalDefinitionProperties(
+ provisioningState,
+ displayName,
+ SignalKind.PrometheusMetricsQuery,
+ refreshInterval,
+ labels,
+ dataUnit,
+ evaluationRules,
+ deletedOn,
+ serializedAdditionalRawData: null,
+ queryText,
+ timeGrain);
+ }
+
+ /// Initializes a new instance of .
+ /// The id.
+ /// The name.
+ /// The resourceType.
+ /// The systemData.
+ ///
+ /// The resource-specific properties for this resource.
+ /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
+ /// The available derived classes include .
+ ///
+ /// A new instance for mocking.
+ public static AuthenticationSettingData AuthenticationSettingData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AuthenticationSettingProperties properties = null)
+ {
+ return new AuthenticationSettingData(
+ id,
+ name,
+ resourceType,
+ systemData,
+ properties,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The status of the last operation.
+ /// Display name.
+ /// Kind of the authentication setting.
+ /// A new instance for mocking.
+ public static AuthenticationSettingProperties AuthenticationSettingProperties(HealthModelProvisioningState? provisioningState = null, string displayName = null, string authenticationKind = null)
+ {
+ return new UnknownAuthenticationSettingProperties(provisioningState, displayName, authenticationKind == null ? default : new AuthenticationKind(authenticationKind), serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The status of the last operation.
+ /// Display name.
+ /// Name of the managed identity to use. Either 'SystemAssigned' or the resourceId of a user-assigned identity.
+ /// A new instance for mocking.
+ public static ManagedIdentityAuthenticationSettingProperties ManagedIdentityAuthenticationSettingProperties(HealthModelProvisioningState? provisioningState = null, string displayName = null, string managedIdentityName = null)
+ {
+ return new ManagedIdentityAuthenticationSettingProperties(provisioningState, displayName, AuthenticationKind.ManagedIdentity, serializedAdditionalRawData: null, managedIdentityName);
+ }
+
+ /// Initializes a new instance of .
+ /// The id.
+ /// The name.
+ /// The resourceType.
+ /// The systemData.
+ /// The resource-specific properties for this resource.
+ /// A new instance for mocking.
+ public static EntityData EntityData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, EntityProperties properties = null)
+ {
+ return new EntityData(
+ id,
+ name,
+ resourceType,
+ systemData,
+ properties,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The status of the last operation.
+ /// Display name.
+ /// Entity kind.
+ /// Positioning of the entity on the model canvas.
+ /// Visual icon definition. If not set, a default icon is used.
+ /// Health objective as a percentage of time the entity should be healthy.
+ /// Impact of the entity in health state propagation.
+ /// Optional set of labels (key-value pairs).
+ /// Signal groups which are assigned to this entity.
+ /// Discovered by which discovery rule. If set, the entity cannot be deleted manually.
+ /// Date when the entity was (soft-)deleted.
+ /// Health state of this entity.
+ /// Alert configuration for this entity.
+ /// A new instance for mocking.
+ public static EntityProperties EntityProperties(HealthModelProvisioningState? provisioningState = null, string displayName = null, string kind = null, EntityCoordinates canvasPosition = null, IconDefinition icon = null, float? healthObjective = null, EntityImpact? impact = null, IDictionary labels = null, SignalGroup signals = null, string discoveredBy = null, DateTimeOffset? deletedOn = null, HealthState? healthState = null, EntityAlerts alerts = null)
+ {
+ labels ??= new Dictionary();
+
+ return new EntityProperties(
+ provisioningState,
+ displayName,
+ kind,
+ canvasPosition,
+ icon,
+ healthObjective,
+ impact,
+ labels,
+ signals,
+ discoveredBy,
+ deletedOn,
+ healthState,
+ alerts,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The id.
+ /// The name.
+ /// The resourceType.
+ /// The systemData.
+ /// The resource-specific properties for this resource.
+ /// A new instance for mocking.
+ public static RelationshipData RelationshipData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, RelationshipProperties properties = null)
+ {
+ return new RelationshipData(
+ id,
+ name,
+ resourceType,
+ systemData,
+ properties,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The status of the last operation.
+ /// Display name.
+ /// Resource name of the parent entity.
+ /// Resource name of the child entity.
+ /// Optional set of labels (key-value pairs).
+ /// Discovered by which discovery rule. If set, the relationship cannot be deleted manually.
+ /// Date when the relationship was (soft-)deleted.
+ /// A new instance for mocking.
+ public static RelationshipProperties RelationshipProperties(HealthModelProvisioningState? provisioningState = null, string displayName = null, string parentEntityName = null, string childEntityName = null, IDictionary labels = null, string discoveredBy = null, DateTimeOffset? deletedOn = null)
+ {
+ labels ??= new Dictionary();
+
+ return new RelationshipProperties(
+ provisioningState,
+ displayName,
+ parentEntityName,
+ childEntityName,
+ labels,
+ discoveredBy,
+ deletedOn,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The id.
+ /// The name.
+ /// The resourceType.
+ /// The systemData.
+ /// The resource-specific properties for this resource.
+ /// A new instance for mocking.
+ public static DiscoveryRuleData DiscoveryRuleData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DiscoveryRuleProperties properties = null)
+ {
+ return new DiscoveryRuleData(
+ id,
+ name,
+ resourceType,
+ systemData,
+ properties,
+ serializedAdditionalRawData: null);
+ }
+
+ /// Initializes a new instance of .
+ /// The status of the last operation.
+ /// Display name.
+ /// Azure Resource Graph query text in KQL syntax. The query must return at least a column named 'id' which contains the resource ID of the discovered resources.
+ /// Reference to the name of the authentication setting which is used for querying Azure Resource Graph. The same authentication setting will also be assigned to any discovered entities.
+ /// Whether to create relationships between the discovered entities based on a set of built-in rules. These relationships cannot be manually deleted.
+ /// Whether to add all recommended signals to the discovered entities.
+ /// Date when the discovery rule was (soft-)deleted.
+ /// Error message if the last discovery operation failed.
+ /// Number of discovered entities in the last discovery operation.
+ /// Name of the entity which represents the discovery rule. Note: It might take a few minutes after creating the discovery rule until the entity is created.
+ /// A new instance for mocking.
+ public static DiscoveryRuleProperties DiscoveryRuleProperties(HealthModelProvisioningState? provisioningState = null, string displayName = null, string resourceGraphQuery = null, string authenticationSetting = null, DiscoveryRuleRelationshipDiscoveryBehavior discoverRelationships = default, DiscoveryRuleRecommendedSignalsBehavior addRecommendedSignals = default, DateTimeOffset? deletedOn = null, string errorMessage = null, int? numberOfDiscoveredEntities = null, string entityName = null)
+ {
+ return new DiscoveryRuleProperties(
+ provisioningState,
+ displayName,
+ resourceGraphQuery,
+ authenticationSetting,
+ discoverRelationships,
+ addRecommendedSignals,
+ deletedOn,
+ errorMessage,
+ numberOfDiscoveredEntities,
+ entityName,
+ serializedAdditionalRawData: null);
+ }
+ }
+}
diff --git a/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/AuthenticationSettingCollection.cs b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/AuthenticationSettingCollection.cs
new file mode 100644
index 000000000000..2aa52f4e980a
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/AuthenticationSettingCollection.cs
@@ -0,0 +1,497 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Threading;
+using System.Threading.Tasks;
+using Autorest.CSharp.Core;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.ResourceManager.CloudHealth
+{
+ ///
+ /// A class representing a collection of and their operations.
+ /// Each in the collection will belong to the same instance of .
+ /// To get an instance call the GetAuthenticationSettings method from an instance of .
+ ///
+ public partial class AuthenticationSettingCollection : ArmCollection, IEnumerable, IAsyncEnumerable
+ {
+ private readonly ClientDiagnostics _authenticationSettingClientDiagnostics;
+ private readonly AuthenticationSettingsRestOperations _authenticationSettingRestClient;
+
+ /// Initializes a new instance of the class for mocking.
+ protected AuthenticationSettingCollection()
+ {
+ }
+
+ /// 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 AuthenticationSettingCollection(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ _authenticationSettingClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CloudHealth", AuthenticationSettingResource.ResourceType.Namespace, Diagnostics);
+ TryGetApiVersion(AuthenticationSettingResource.ResourceType, out string authenticationSettingApiVersion);
+ _authenticationSettingRestClient = new AuthenticationSettingsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, authenticationSettingApiVersion);
+#if DEBUG
+ ValidateResourceId(Id);
+#endif
+ }
+
+ internal static void ValidateResourceId(ResourceIdentifier id)
+ {
+ if (id.ResourceType != HealthModelResource.ResourceType)
+ throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, HealthModelResource.ResourceType), nameof(id));
+ }
+
+ ///
+ /// Create a AuthenticationSetting
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/authenticationsettings/{authenticationSettingName}
+ ///
+ /// -
+ /// Operation Id
+ /// AuthenticationSetting_CreateOrUpdate
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-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.
+ /// Name of the authentication setting. Must be unique within a health model.
+ /// Resource create parameters.
+ /// 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 authenticationSettingName, AuthenticationSettingData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(authenticationSettingName, nameof(authenticationSettingName));
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _authenticationSettingClientDiagnostics.CreateScope("AuthenticationSettingCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var response = await _authenticationSettingRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, authenticationSettingName, data, cancellationToken).ConfigureAwait(false);
+ var uri = _authenticationSettingRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, authenticationSettingName, data);
+ var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString());
+ var operation = new CloudHealthArmOperation(Response.FromValue(new AuthenticationSettingResource(Client, response), response.GetRawResponse()), rehydrationToken);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Create a AuthenticationSetting
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/authenticationsettings/{authenticationSettingName}
+ ///
+ /// -
+ /// Operation Id
+ /// AuthenticationSetting_CreateOrUpdate
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-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.
+ /// Name of the authentication setting. Must be unique within a health model.
+ /// Resource create parameters.
+ /// 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 authenticationSettingName, AuthenticationSettingData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(authenticationSettingName, nameof(authenticationSettingName));
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _authenticationSettingClientDiagnostics.CreateScope("AuthenticationSettingCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var response = _authenticationSettingRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, authenticationSettingName, data, cancellationToken);
+ var uri = _authenticationSettingRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, authenticationSettingName, data);
+ var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString());
+ var operation = new CloudHealthArmOperation(Response.FromValue(new AuthenticationSettingResource(Client, response), response.GetRawResponse()), rehydrationToken);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletion(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a AuthenticationSetting
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/authenticationsettings/{authenticationSettingName}
+ ///
+ /// -
+ /// Operation Id
+ /// AuthenticationSetting_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of the authentication setting. Must be unique within a health model.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> GetAsync(string authenticationSettingName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(authenticationSettingName, nameof(authenticationSettingName));
+
+ using var scope = _authenticationSettingClientDiagnostics.CreateScope("AuthenticationSettingCollection.Get");
+ scope.Start();
+ try
+ {
+ var response = await _authenticationSettingRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, authenticationSettingName, cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new AuthenticationSettingResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a AuthenticationSetting
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/authenticationsettings/{authenticationSettingName}
+ ///
+ /// -
+ /// Operation Id
+ /// AuthenticationSetting_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of the authentication setting. Must be unique within a health model.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response Get(string authenticationSettingName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(authenticationSettingName, nameof(authenticationSettingName));
+
+ using var scope = _authenticationSettingClientDiagnostics.CreateScope("AuthenticationSettingCollection.Get");
+ scope.Start();
+ try
+ {
+ var response = _authenticationSettingRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, authenticationSettingName, cancellationToken);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new AuthenticationSettingResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// List AuthenticationSetting resources by HealthModel
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/authenticationsettings
+ ///
+ /// -
+ /// Operation Id
+ /// AuthenticationSetting_ListByHealthModel
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-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) => _authenticationSettingRestClient.CreateListByHealthModelRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _authenticationSettingRestClient.CreateListByHealthModelNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name);
+ return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new AuthenticationSettingResource(Client, AuthenticationSettingData.DeserializeAuthenticationSettingData(e)), _authenticationSettingClientDiagnostics, Pipeline, "AuthenticationSettingCollection.GetAll", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// List AuthenticationSetting resources by HealthModel
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/authenticationsettings
+ ///
+ /// -
+ /// Operation Id
+ /// AuthenticationSetting_ListByHealthModel
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-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) => _authenticationSettingRestClient.CreateListByHealthModelRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _authenticationSettingRestClient.CreateListByHealthModelNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name);
+ return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new AuthenticationSettingResource(Client, AuthenticationSettingData.DeserializeAuthenticationSettingData(e)), _authenticationSettingClientDiagnostics, Pipeline, "AuthenticationSettingCollection.GetAll", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// Checks to see if the resource exists in azure.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/authenticationsettings/{authenticationSettingName}
+ ///
+ /// -
+ /// Operation Id
+ /// AuthenticationSetting_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of the authentication setting. Must be unique within a health model.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> ExistsAsync(string authenticationSettingName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(authenticationSettingName, nameof(authenticationSettingName));
+
+ using var scope = _authenticationSettingClientDiagnostics.CreateScope("AuthenticationSettingCollection.Exists");
+ scope.Start();
+ try
+ {
+ var response = await _authenticationSettingRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, authenticationSettingName, 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.CloudHealth/healthmodels/{healthModelName}/authenticationsettings/{authenticationSettingName}
+ ///
+ /// -
+ /// Operation Id
+ /// AuthenticationSetting_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of the authentication setting. Must be unique within a health model.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response Exists(string authenticationSettingName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(authenticationSettingName, nameof(authenticationSettingName));
+
+ using var scope = _authenticationSettingClientDiagnostics.CreateScope("AuthenticationSettingCollection.Exists");
+ scope.Start();
+ try
+ {
+ var response = _authenticationSettingRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, authenticationSettingName, 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.CloudHealth/healthmodels/{healthModelName}/authenticationsettings/{authenticationSettingName}
+ ///
+ /// -
+ /// Operation Id
+ /// AuthenticationSetting_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of the authentication setting. Must be unique within a health model.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> GetIfExistsAsync(string authenticationSettingName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(authenticationSettingName, nameof(authenticationSettingName));
+
+ using var scope = _authenticationSettingClientDiagnostics.CreateScope("AuthenticationSettingCollection.GetIfExists");
+ scope.Start();
+ try
+ {
+ var response = await _authenticationSettingRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, authenticationSettingName, cancellationToken: cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ return new NoValueResponse(response.GetRawResponse());
+ return Response.FromValue(new AuthenticationSettingResource(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.CloudHealth/healthmodels/{healthModelName}/authenticationsettings/{authenticationSettingName}
+ ///
+ /// -
+ /// Operation Id
+ /// AuthenticationSetting_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of the authentication setting. Must be unique within a health model.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual NullableResponse GetIfExists(string authenticationSettingName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(authenticationSettingName, nameof(authenticationSettingName));
+
+ using var scope = _authenticationSettingClientDiagnostics.CreateScope("AuthenticationSettingCollection.GetIfExists");
+ scope.Start();
+ try
+ {
+ var response = _authenticationSettingRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, authenticationSettingName, cancellationToken: cancellationToken);
+ if (response.Value == null)
+ return new NoValueResponse(response.GetRawResponse());
+ return Response.FromValue(new AuthenticationSettingResource(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/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/AuthenticationSettingData.Serialization.cs b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/AuthenticationSettingData.Serialization.cs
new file mode 100644
index 000000000000..126c36e8bce2
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/AuthenticationSettingData.Serialization.cs
@@ -0,0 +1,155 @@
+// 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.CloudHealth.Models;
+using Azure.ResourceManager.Models;
+
+namespace Azure.ResourceManager.CloudHealth
+{
+ public partial class AuthenticationSettingData : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(AuthenticationSettingData)} does not support writing '{format}' format.");
+ }
+
+ base.JsonModelWriteCore(writer, options);
+ if (Optional.IsDefined(Properties))
+ {
+ writer.WritePropertyName("properties"u8);
+ writer.WriteObjectValue(Properties, options);
+ }
+ }
+
+ AuthenticationSettingData 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(AuthenticationSettingData)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeAuthenticationSettingData(document.RootElement, options);
+ }
+
+ internal static AuthenticationSettingData DeserializeAuthenticationSettingData(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ AuthenticationSettingProperties properties = default;
+ ResourceIdentifier id = default;
+ string name = default;
+ ResourceType type = default;
+ SystemData systemData = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("properties"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ properties = AuthenticationSettingProperties.DeserializeAuthenticationSettingProperties(property.Value, options);
+ 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 (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new AuthenticationSettingData(
+ id,
+ name,
+ type,
+ systemData,
+ properties,
+ 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(AuthenticationSettingData)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ AuthenticationSettingData 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, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeAuthenticationSettingData(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(AuthenticationSettingData)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+ }
+}
diff --git a/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/AuthenticationSettingData.cs b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/AuthenticationSettingData.cs
new file mode 100644
index 000000000000..34d98d972656
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/AuthenticationSettingData.cs
@@ -0,0 +1,83 @@
+// 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.CloudHealth.Models;
+using Azure.ResourceManager.Models;
+
+namespace Azure.ResourceManager.CloudHealth
+{
+ ///
+ /// A class representing the AuthenticationSetting data model.
+ /// An authentication setting in a health model
+ ///
+ public partial class AuthenticationSettingData : 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 AuthenticationSettingData()
+ {
+ }
+
+ /// Initializes a new instance of .
+ /// The id.
+ /// The name.
+ /// The resourceType.
+ /// The systemData.
+ ///
+ /// The resource-specific properties for this resource.
+ /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
+ /// The available derived classes include .
+ ///
+ /// Keeps track of any properties unknown to the library.
+ internal AuthenticationSettingData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AuthenticationSettingProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData)
+ {
+ Properties = properties;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ ///
+ /// The resource-specific properties for this resource.
+ /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes.
+ /// The available derived classes include .
+ ///
+ public AuthenticationSettingProperties Properties { get; set; }
+ }
+}
diff --git a/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/AuthenticationSettingResource.Serialization.cs b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/AuthenticationSettingResource.Serialization.cs
new file mode 100644
index 000000000000..a238b5b713a8
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/AuthenticationSettingResource.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.CloudHealth
+{
+ public partial class AuthenticationSettingResource : IJsonModel
+ {
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options);
+
+ AuthenticationSettingData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options);
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options);
+
+ AuthenticationSettingData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options);
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options);
+ }
+}
diff --git a/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/AuthenticationSettingResource.cs b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/AuthenticationSettingResource.cs
new file mode 100644
index 000000000000..b320ced926bb
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/AuthenticationSettingResource.cs
@@ -0,0 +1,355 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Globalization;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.ResourceManager.CloudHealth
+{
+ ///
+ /// A Class representing an AuthenticationSetting along with the instance operations that can be performed on it.
+ /// If you have a you can construct an
+ /// from an instance of using the GetAuthenticationSettingResource method.
+ /// Otherwise you can get one from its parent resource using the GetAuthenticationSetting method.
+ ///
+ public partial class AuthenticationSettingResource : ArmResource
+ {
+ /// Generate the resource identifier of a instance.
+ /// The subscriptionId.
+ /// The resourceGroupName.
+ /// The healthModelName.
+ /// The authenticationSettingName.
+ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string healthModelName, string authenticationSettingName)
+ {
+ var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/authenticationsettings/{authenticationSettingName}";
+ return new ResourceIdentifier(resourceId);
+ }
+
+ private readonly ClientDiagnostics _authenticationSettingClientDiagnostics;
+ private readonly AuthenticationSettingsRestOperations _authenticationSettingRestClient;
+ private readonly AuthenticationSettingData _data;
+
+ /// Gets the resource type for the operations.
+ public static readonly ResourceType ResourceType = "Microsoft.CloudHealth/healthmodels/authenticationsettings";
+
+ /// Initializes a new instance of the class for mocking.
+ protected AuthenticationSettingResource()
+ {
+ }
+
+ /// Initializes a new instance of the class.
+ /// The client parameters to use in these operations.
+ /// The resource that is the target of operations.
+ internal AuthenticationSettingResource(ArmClient client, AuthenticationSettingData 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 AuthenticationSettingResource(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ _authenticationSettingClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CloudHealth", ResourceType.Namespace, Diagnostics);
+ TryGetApiVersion(ResourceType, out string authenticationSettingApiVersion);
+ _authenticationSettingRestClient = new AuthenticationSettingsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, authenticationSettingApiVersion);
+#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 AuthenticationSettingData 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));
+ }
+
+ ///
+ /// Get a AuthenticationSetting
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/authenticationsettings/{authenticationSettingName}
+ ///
+ /// -
+ /// Operation Id
+ /// AuthenticationSetting_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual async Task> GetAsync(CancellationToken cancellationToken = default)
+ {
+ using var scope = _authenticationSettingClientDiagnostics.CreateScope("AuthenticationSettingResource.Get");
+ scope.Start();
+ try
+ {
+ var response = await _authenticationSettingRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new AuthenticationSettingResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a AuthenticationSetting
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/authenticationsettings/{authenticationSettingName}
+ ///
+ /// -
+ /// Operation Id
+ /// AuthenticationSetting_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual Response Get(CancellationToken cancellationToken = default)
+ {
+ using var scope = _authenticationSettingClientDiagnostics.CreateScope("AuthenticationSettingResource.Get");
+ scope.Start();
+ try
+ {
+ var response = _authenticationSettingRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new AuthenticationSettingResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Delete a AuthenticationSetting
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/authenticationsettings/{authenticationSettingName}
+ ///
+ /// -
+ /// Operation Id
+ /// AuthenticationSetting_Delete
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-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 = _authenticationSettingClientDiagnostics.CreateScope("AuthenticationSettingResource.Delete");
+ scope.Start();
+ try
+ {
+ var response = await _authenticationSettingRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
+ var uri = _authenticationSettingRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name);
+ var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString());
+ var operation = new CloudHealthArmOperation(response, rehydrationToken);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Delete a AuthenticationSetting
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/authenticationsettings/{authenticationSettingName}
+ ///
+ /// -
+ /// Operation Id
+ /// AuthenticationSetting_Delete
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-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 = _authenticationSettingClientDiagnostics.CreateScope("AuthenticationSettingResource.Delete");
+ scope.Start();
+ try
+ {
+ var response = _authenticationSettingRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken);
+ var uri = _authenticationSettingRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name);
+ var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString());
+ var operation = new CloudHealthArmOperation(response, rehydrationToken);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletionResponse(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Create a AuthenticationSetting
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/authenticationsettings/{authenticationSettingName}
+ ///
+ /// -
+ /// Operation Id
+ /// AuthenticationSetting_CreateOrUpdate
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-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.
+ /// Resource create parameters.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual async Task> UpdateAsync(WaitUntil waitUntil, AuthenticationSettingData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _authenticationSettingClientDiagnostics.CreateScope("AuthenticationSettingResource.Update");
+ scope.Start();
+ try
+ {
+ var response = await _authenticationSettingRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false);
+ var uri = _authenticationSettingRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data);
+ var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString());
+ var operation = new CloudHealthArmOperation(Response.FromValue(new AuthenticationSettingResource(Client, response), response.GetRawResponse()), rehydrationToken);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Create a AuthenticationSetting
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/authenticationsettings/{authenticationSettingName}
+ ///
+ /// -
+ /// Operation Id
+ /// AuthenticationSetting_CreateOrUpdate
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-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.
+ /// Resource create parameters.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual ArmOperation Update(WaitUntil waitUntil, AuthenticationSettingData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _authenticationSettingClientDiagnostics.CreateScope("AuthenticationSettingResource.Update");
+ scope.Start();
+ try
+ {
+ var response = _authenticationSettingRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken);
+ var uri = _authenticationSettingRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data);
+ var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString());
+ var operation = new CloudHealthArmOperation(Response.FromValue(new AuthenticationSettingResource(Client, response), response.GetRawResponse()), rehydrationToken);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletion(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/DiscoveryRuleCollection.cs b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/DiscoveryRuleCollection.cs
new file mode 100644
index 000000000000..db9cf7e60aee
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/DiscoveryRuleCollection.cs
@@ -0,0 +1,499 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Threading;
+using System.Threading.Tasks;
+using Autorest.CSharp.Core;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.ResourceManager.CloudHealth
+{
+ ///
+ /// 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 GetDiscoveryRules method from an instance of .
+ ///
+ public partial class DiscoveryRuleCollection : ArmCollection, IEnumerable, IAsyncEnumerable
+ {
+ private readonly ClientDiagnostics _discoveryRuleClientDiagnostics;
+ private readonly DiscoveryRulesRestOperations _discoveryRuleRestClient;
+
+ /// Initializes a new instance of the class for mocking.
+ protected DiscoveryRuleCollection()
+ {
+ }
+
+ /// 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 DiscoveryRuleCollection(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ _discoveryRuleClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CloudHealth", DiscoveryRuleResource.ResourceType.Namespace, Diagnostics);
+ TryGetApiVersion(DiscoveryRuleResource.ResourceType, out string discoveryRuleApiVersion);
+ _discoveryRuleRestClient = new DiscoveryRulesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, discoveryRuleApiVersion);
+#if DEBUG
+ ValidateResourceId(Id);
+#endif
+ }
+
+ internal static void ValidateResourceId(ResourceIdentifier id)
+ {
+ if (id.ResourceType != HealthModelResource.ResourceType)
+ throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, HealthModelResource.ResourceType), nameof(id));
+ }
+
+ ///
+ /// Create a DiscoveryRule
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/discoveryrules/{discoveryRuleName}
+ ///
+ /// -
+ /// Operation Id
+ /// DiscoveryRule_CreateOrUpdate
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-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.
+ /// Name of the discovery rule. Must be unique within a health model.
+ /// Resource create parameters.
+ /// 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 discoveryRuleName, DiscoveryRuleData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(discoveryRuleName, nameof(discoveryRuleName));
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _discoveryRuleClientDiagnostics.CreateScope("DiscoveryRuleCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var response = await _discoveryRuleRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveryRuleName, data, cancellationToken).ConfigureAwait(false);
+ var uri = _discoveryRuleRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveryRuleName, data);
+ var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString());
+ var operation = new CloudHealthArmOperation(Response.FromValue(new DiscoveryRuleResource(Client, response), response.GetRawResponse()), rehydrationToken);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Create a DiscoveryRule
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/discoveryrules/{discoveryRuleName}
+ ///
+ /// -
+ /// Operation Id
+ /// DiscoveryRule_CreateOrUpdate
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-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.
+ /// Name of the discovery rule. Must be unique within a health model.
+ /// Resource create parameters.
+ /// 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 discoveryRuleName, DiscoveryRuleData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(discoveryRuleName, nameof(discoveryRuleName));
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _discoveryRuleClientDiagnostics.CreateScope("DiscoveryRuleCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var response = _discoveryRuleRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveryRuleName, data, cancellationToken);
+ var uri = _discoveryRuleRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveryRuleName, data);
+ var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString());
+ var operation = new CloudHealthArmOperation(Response.FromValue(new DiscoveryRuleResource(Client, response), response.GetRawResponse()), rehydrationToken);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletion(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a DiscoveryRule
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/discoveryrules/{discoveryRuleName}
+ ///
+ /// -
+ /// Operation Id
+ /// DiscoveryRule_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of the discovery rule. Must be unique within a health model.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> GetAsync(string discoveryRuleName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(discoveryRuleName, nameof(discoveryRuleName));
+
+ using var scope = _discoveryRuleClientDiagnostics.CreateScope("DiscoveryRuleCollection.Get");
+ scope.Start();
+ try
+ {
+ var response = await _discoveryRuleRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveryRuleName, cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new DiscoveryRuleResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a DiscoveryRule
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/discoveryrules/{discoveryRuleName}
+ ///
+ /// -
+ /// Operation Id
+ /// DiscoveryRule_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of the discovery rule. Must be unique within a health model.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response Get(string discoveryRuleName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(discoveryRuleName, nameof(discoveryRuleName));
+
+ using var scope = _discoveryRuleClientDiagnostics.CreateScope("DiscoveryRuleCollection.Get");
+ scope.Start();
+ try
+ {
+ var response = _discoveryRuleRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveryRuleName, cancellationToken);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new DiscoveryRuleResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// List DiscoveryRule resources by HealthModel
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/discoveryrules
+ ///
+ /// -
+ /// Operation Id
+ /// DiscoveryRule_ListByHealthModel
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Timestamp to use for the operation. When specified, the version of the resource at this point in time is retrieved. If not specified, the latest version is used.
+ /// The cancellation token to use.
+ /// An async collection of that may take multiple service requests to iterate over.
+ public virtual AsyncPageable GetAllAsync(DateTimeOffset? timestamp = null, CancellationToken cancellationToken = default)
+ {
+ HttpMessage FirstPageRequest(int? pageSizeHint) => _discoveryRuleRestClient.CreateListByHealthModelRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, timestamp);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _discoveryRuleRestClient.CreateListByHealthModelNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, timestamp);
+ return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DiscoveryRuleResource(Client, DiscoveryRuleData.DeserializeDiscoveryRuleData(e)), _discoveryRuleClientDiagnostics, Pipeline, "DiscoveryRuleCollection.GetAll", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// List DiscoveryRule resources by HealthModel
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/discoveryrules
+ ///
+ /// -
+ /// Operation Id
+ /// DiscoveryRule_ListByHealthModel
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Timestamp to use for the operation. When specified, the version of the resource at this point in time is retrieved. If not specified, the latest version is used.
+ /// The cancellation token to use.
+ /// A collection of that may take multiple service requests to iterate over.
+ public virtual Pageable GetAll(DateTimeOffset? timestamp = null, CancellationToken cancellationToken = default)
+ {
+ HttpMessage FirstPageRequest(int? pageSizeHint) => _discoveryRuleRestClient.CreateListByHealthModelRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, timestamp);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _discoveryRuleRestClient.CreateListByHealthModelNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, timestamp);
+ return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DiscoveryRuleResource(Client, DiscoveryRuleData.DeserializeDiscoveryRuleData(e)), _discoveryRuleClientDiagnostics, Pipeline, "DiscoveryRuleCollection.GetAll", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// Checks to see if the resource exists in azure.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/discoveryrules/{discoveryRuleName}
+ ///
+ /// -
+ /// Operation Id
+ /// DiscoveryRule_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of the discovery rule. Must be unique within a health model.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> ExistsAsync(string discoveryRuleName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(discoveryRuleName, nameof(discoveryRuleName));
+
+ using var scope = _discoveryRuleClientDiagnostics.CreateScope("DiscoveryRuleCollection.Exists");
+ scope.Start();
+ try
+ {
+ var response = await _discoveryRuleRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveryRuleName, 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.CloudHealth/healthmodels/{healthModelName}/discoveryrules/{discoveryRuleName}
+ ///
+ /// -
+ /// Operation Id
+ /// DiscoveryRule_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of the discovery rule. Must be unique within a health model.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response Exists(string discoveryRuleName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(discoveryRuleName, nameof(discoveryRuleName));
+
+ using var scope = _discoveryRuleClientDiagnostics.CreateScope("DiscoveryRuleCollection.Exists");
+ scope.Start();
+ try
+ {
+ var response = _discoveryRuleRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveryRuleName, 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.CloudHealth/healthmodels/{healthModelName}/discoveryrules/{discoveryRuleName}
+ ///
+ /// -
+ /// Operation Id
+ /// DiscoveryRule_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of the discovery rule. Must be unique within a health model.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> GetIfExistsAsync(string discoveryRuleName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(discoveryRuleName, nameof(discoveryRuleName));
+
+ using var scope = _discoveryRuleClientDiagnostics.CreateScope("DiscoveryRuleCollection.GetIfExists");
+ scope.Start();
+ try
+ {
+ var response = await _discoveryRuleRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveryRuleName, cancellationToken: cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ return new NoValueResponse(response.GetRawResponse());
+ return Response.FromValue(new DiscoveryRuleResource(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.CloudHealth/healthmodels/{healthModelName}/discoveryrules/{discoveryRuleName}
+ ///
+ /// -
+ /// Operation Id
+ /// DiscoveryRule_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of the discovery rule. Must be unique within a health model.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual NullableResponse GetIfExists(string discoveryRuleName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(discoveryRuleName, nameof(discoveryRuleName));
+
+ using var scope = _discoveryRuleClientDiagnostics.CreateScope("DiscoveryRuleCollection.GetIfExists");
+ scope.Start();
+ try
+ {
+ var response = _discoveryRuleRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, discoveryRuleName, cancellationToken: cancellationToken);
+ if (response.Value == null)
+ return new NoValueResponse(response.GetRawResponse());
+ return Response.FromValue(new DiscoveryRuleResource(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/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/DiscoveryRuleData.Serialization.cs b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/DiscoveryRuleData.Serialization.cs
new file mode 100644
index 000000000000..747836168ade
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/DiscoveryRuleData.Serialization.cs
@@ -0,0 +1,155 @@
+// 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.CloudHealth.Models;
+using Azure.ResourceManager.Models;
+
+namespace Azure.ResourceManager.CloudHealth
+{
+ public partial class DiscoveryRuleData : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(DiscoveryRuleData)} does not support writing '{format}' format.");
+ }
+
+ base.JsonModelWriteCore(writer, options);
+ if (Optional.IsDefined(Properties))
+ {
+ writer.WritePropertyName("properties"u8);
+ writer.WriteObjectValue(Properties, options);
+ }
+ }
+
+ DiscoveryRuleData 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(DiscoveryRuleData)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeDiscoveryRuleData(document.RootElement, options);
+ }
+
+ internal static DiscoveryRuleData DeserializeDiscoveryRuleData(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ DiscoveryRuleProperties properties = default;
+ ResourceIdentifier id = default;
+ string name = default;
+ ResourceType type = default;
+ SystemData systemData = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("properties"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ properties = DiscoveryRuleProperties.DeserializeDiscoveryRuleProperties(property.Value, options);
+ 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 (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new DiscoveryRuleData(
+ id,
+ name,
+ type,
+ systemData,
+ properties,
+ 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(DiscoveryRuleData)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ DiscoveryRuleData 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, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeDiscoveryRuleData(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(DiscoveryRuleData)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+ }
+}
diff --git a/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/DiscoveryRuleData.cs b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/DiscoveryRuleData.cs
new file mode 100644
index 000000000000..b0a2040e717b
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/DiscoveryRuleData.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.CloudHealth.Models;
+using Azure.ResourceManager.Models;
+
+namespace Azure.ResourceManager.CloudHealth
+{
+ ///
+ /// A class representing the DiscoveryRule data model.
+ /// A discovery rule which automatically finds entities and relationships in a health model based on an Azure Resource Graph query
+ ///
+ public partial class DiscoveryRuleData : 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 DiscoveryRuleData()
+ {
+ }
+
+ /// Initializes a new instance of .
+ /// The id.
+ /// The name.
+ /// The resourceType.
+ /// The systemData.
+ /// The resource-specific properties for this resource.
+ /// Keeps track of any properties unknown to the library.
+ internal DiscoveryRuleData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DiscoveryRuleProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData)
+ {
+ Properties = properties;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// The resource-specific properties for this resource.
+ public DiscoveryRuleProperties Properties { get; set; }
+ }
+}
diff --git a/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/DiscoveryRuleResource.Serialization.cs b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/DiscoveryRuleResource.Serialization.cs
new file mode 100644
index 000000000000..be81652e4cb2
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/DiscoveryRuleResource.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.CloudHealth
+{
+ public partial class DiscoveryRuleResource : IJsonModel
+ {
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options);
+
+ DiscoveryRuleData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options);
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options);
+
+ DiscoveryRuleData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options);
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options);
+ }
+}
diff --git a/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/DiscoveryRuleResource.cs b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/DiscoveryRuleResource.cs
new file mode 100644
index 000000000000..ba3a2c28f578
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/DiscoveryRuleResource.cs
@@ -0,0 +1,355 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Globalization;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.ResourceManager.CloudHealth
+{
+ ///
+ /// A Class representing a DiscoveryRule 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 GetDiscoveryRuleResource method.
+ /// Otherwise you can get one from its parent resource using the GetDiscoveryRule method.
+ ///
+ public partial class DiscoveryRuleResource : ArmResource
+ {
+ /// Generate the resource identifier of a instance.
+ /// The subscriptionId.
+ /// The resourceGroupName.
+ /// The healthModelName.
+ /// The discoveryRuleName.
+ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string healthModelName, string discoveryRuleName)
+ {
+ var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/discoveryrules/{discoveryRuleName}";
+ return new ResourceIdentifier(resourceId);
+ }
+
+ private readonly ClientDiagnostics _discoveryRuleClientDiagnostics;
+ private readonly DiscoveryRulesRestOperations _discoveryRuleRestClient;
+ private readonly DiscoveryRuleData _data;
+
+ /// Gets the resource type for the operations.
+ public static readonly ResourceType ResourceType = "Microsoft.CloudHealth/healthmodels/discoveryrules";
+
+ /// Initializes a new instance of the class for mocking.
+ protected DiscoveryRuleResource()
+ {
+ }
+
+ /// Initializes a new instance of the class.
+ /// The client parameters to use in these operations.
+ /// The resource that is the target of operations.
+ internal DiscoveryRuleResource(ArmClient client, DiscoveryRuleData 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 DiscoveryRuleResource(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ _discoveryRuleClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CloudHealth", ResourceType.Namespace, Diagnostics);
+ TryGetApiVersion(ResourceType, out string discoveryRuleApiVersion);
+ _discoveryRuleRestClient = new DiscoveryRulesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, discoveryRuleApiVersion);
+#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 DiscoveryRuleData 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));
+ }
+
+ ///
+ /// Get a DiscoveryRule
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/discoveryrules/{discoveryRuleName}
+ ///
+ /// -
+ /// Operation Id
+ /// DiscoveryRule_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual async Task> GetAsync(CancellationToken cancellationToken = default)
+ {
+ using var scope = _discoveryRuleClientDiagnostics.CreateScope("DiscoveryRuleResource.Get");
+ scope.Start();
+ try
+ {
+ var response = await _discoveryRuleRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new DiscoveryRuleResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a DiscoveryRule
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/discoveryrules/{discoveryRuleName}
+ ///
+ /// -
+ /// Operation Id
+ /// DiscoveryRule_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual Response Get(CancellationToken cancellationToken = default)
+ {
+ using var scope = _discoveryRuleClientDiagnostics.CreateScope("DiscoveryRuleResource.Get");
+ scope.Start();
+ try
+ {
+ var response = _discoveryRuleRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new DiscoveryRuleResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Delete a DiscoveryRule
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/discoveryrules/{discoveryRuleName}
+ ///
+ /// -
+ /// Operation Id
+ /// DiscoveryRule_Delete
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-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 = _discoveryRuleClientDiagnostics.CreateScope("DiscoveryRuleResource.Delete");
+ scope.Start();
+ try
+ {
+ var response = await _discoveryRuleRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
+ var uri = _discoveryRuleRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name);
+ var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString());
+ var operation = new CloudHealthArmOperation(response, rehydrationToken);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Delete a DiscoveryRule
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/discoveryrules/{discoveryRuleName}
+ ///
+ /// -
+ /// Operation Id
+ /// DiscoveryRule_Delete
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-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 = _discoveryRuleClientDiagnostics.CreateScope("DiscoveryRuleResource.Delete");
+ scope.Start();
+ try
+ {
+ var response = _discoveryRuleRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken);
+ var uri = _discoveryRuleRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name);
+ var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString());
+ var operation = new CloudHealthArmOperation(response, rehydrationToken);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletionResponse(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Create a DiscoveryRule
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/discoveryrules/{discoveryRuleName}
+ ///
+ /// -
+ /// Operation Id
+ /// DiscoveryRule_CreateOrUpdate
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-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.
+ /// Resource create parameters.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual async Task> UpdateAsync(WaitUntil waitUntil, DiscoveryRuleData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _discoveryRuleClientDiagnostics.CreateScope("DiscoveryRuleResource.Update");
+ scope.Start();
+ try
+ {
+ var response = await _discoveryRuleRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false);
+ var uri = _discoveryRuleRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data);
+ var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString());
+ var operation = new CloudHealthArmOperation(Response.FromValue(new DiscoveryRuleResource(Client, response), response.GetRawResponse()), rehydrationToken);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Create a DiscoveryRule
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/discoveryrules/{discoveryRuleName}
+ ///
+ /// -
+ /// Operation Id
+ /// DiscoveryRule_CreateOrUpdate
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-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.
+ /// Resource create parameters.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual ArmOperation Update(WaitUntil waitUntil, DiscoveryRuleData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _discoveryRuleClientDiagnostics.CreateScope("DiscoveryRuleResource.Update");
+ scope.Start();
+ try
+ {
+ var response = _discoveryRuleRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken);
+ var uri = _discoveryRuleRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data);
+ var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString());
+ var operation = new CloudHealthArmOperation(Response.FromValue(new DiscoveryRuleResource(Client, response), response.GetRawResponse()), rehydrationToken);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletion(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/EntityCollection.cs b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/EntityCollection.cs
new file mode 100644
index 000000000000..6330d96ed919
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/EntityCollection.cs
@@ -0,0 +1,499 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Threading;
+using System.Threading.Tasks;
+using Autorest.CSharp.Core;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.ResourceManager.CloudHealth
+{
+ ///
+ /// A class representing a collection of and their operations.
+ /// Each in the collection will belong to the same instance of .
+ /// To get an instance call the GetEntities method from an instance of .
+ ///
+ public partial class EntityCollection : ArmCollection, IEnumerable, IAsyncEnumerable
+ {
+ private readonly ClientDiagnostics _entityClientDiagnostics;
+ private readonly EntitiesRestOperations _entityRestClient;
+
+ /// Initializes a new instance of the class for mocking.
+ protected EntityCollection()
+ {
+ }
+
+ /// 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 EntityCollection(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ _entityClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CloudHealth", EntityResource.ResourceType.Namespace, Diagnostics);
+ TryGetApiVersion(EntityResource.ResourceType, out string entityApiVersion);
+ _entityRestClient = new EntitiesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, entityApiVersion);
+#if DEBUG
+ ValidateResourceId(Id);
+#endif
+ }
+
+ internal static void ValidateResourceId(ResourceIdentifier id)
+ {
+ if (id.ResourceType != HealthModelResource.ResourceType)
+ throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, HealthModelResource.ResourceType), nameof(id));
+ }
+
+ ///
+ /// Create a Entity
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/entities/{entityName}
+ ///
+ /// -
+ /// Operation Id
+ /// Entity_CreateOrUpdate
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-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.
+ /// Name of the entity. Must be unique within a health model.
+ /// Resource create parameters.
+ /// 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 entityName, EntityData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(entityName, nameof(entityName));
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _entityClientDiagnostics.CreateScope("EntityCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var response = await _entityRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, entityName, data, cancellationToken).ConfigureAwait(false);
+ var uri = _entityRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, entityName, data);
+ var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString());
+ var operation = new CloudHealthArmOperation(Response.FromValue(new EntityResource(Client, response), response.GetRawResponse()), rehydrationToken);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Create a Entity
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/entities/{entityName}
+ ///
+ /// -
+ /// Operation Id
+ /// Entity_CreateOrUpdate
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-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.
+ /// Name of the entity. Must be unique within a health model.
+ /// Resource create parameters.
+ /// 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 entityName, EntityData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(entityName, nameof(entityName));
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _entityClientDiagnostics.CreateScope("EntityCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var response = _entityRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, entityName, data, cancellationToken);
+ var uri = _entityRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, entityName, data);
+ var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString());
+ var operation = new CloudHealthArmOperation(Response.FromValue(new EntityResource(Client, response), response.GetRawResponse()), rehydrationToken);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletion(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a Entity
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/entities/{entityName}
+ ///
+ /// -
+ /// Operation Id
+ /// Entity_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of the entity. Must be unique within a health model.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> GetAsync(string entityName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(entityName, nameof(entityName));
+
+ using var scope = _entityClientDiagnostics.CreateScope("EntityCollection.Get");
+ scope.Start();
+ try
+ {
+ var response = await _entityRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, entityName, cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new EntityResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a Entity
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/entities/{entityName}
+ ///
+ /// -
+ /// Operation Id
+ /// Entity_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of the entity. Must be unique within a health model.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response Get(string entityName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(entityName, nameof(entityName));
+
+ using var scope = _entityClientDiagnostics.CreateScope("EntityCollection.Get");
+ scope.Start();
+ try
+ {
+ var response = _entityRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, entityName, cancellationToken);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new EntityResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// List Entity resources by HealthModel
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/entities
+ ///
+ /// -
+ /// Operation Id
+ /// Entity_ListByHealthModel
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Timestamp to use for the operation. When specified, the version of the resource at this point in time is retrieved. If not specified, the latest version is used.
+ /// The cancellation token to use.
+ /// An async collection of that may take multiple service requests to iterate over.
+ public virtual AsyncPageable GetAllAsync(DateTimeOffset? timestamp = null, CancellationToken cancellationToken = default)
+ {
+ HttpMessage FirstPageRequest(int? pageSizeHint) => _entityRestClient.CreateListByHealthModelRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, timestamp);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _entityRestClient.CreateListByHealthModelNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, timestamp);
+ return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EntityResource(Client, EntityData.DeserializeEntityData(e)), _entityClientDiagnostics, Pipeline, "EntityCollection.GetAll", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// List Entity resources by HealthModel
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/entities
+ ///
+ /// -
+ /// Operation Id
+ /// Entity_ListByHealthModel
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Timestamp to use for the operation. When specified, the version of the resource at this point in time is retrieved. If not specified, the latest version is used.
+ /// The cancellation token to use.
+ /// A collection of that may take multiple service requests to iterate over.
+ public virtual Pageable GetAll(DateTimeOffset? timestamp = null, CancellationToken cancellationToken = default)
+ {
+ HttpMessage FirstPageRequest(int? pageSizeHint) => _entityRestClient.CreateListByHealthModelRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, timestamp);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _entityRestClient.CreateListByHealthModelNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, timestamp);
+ return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EntityResource(Client, EntityData.DeserializeEntityData(e)), _entityClientDiagnostics, Pipeline, "EntityCollection.GetAll", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// Checks to see if the resource exists in azure.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/entities/{entityName}
+ ///
+ /// -
+ /// Operation Id
+ /// Entity_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of the entity. Must be unique within a health model.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> ExistsAsync(string entityName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(entityName, nameof(entityName));
+
+ using var scope = _entityClientDiagnostics.CreateScope("EntityCollection.Exists");
+ scope.Start();
+ try
+ {
+ var response = await _entityRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, entityName, 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.CloudHealth/healthmodels/{healthModelName}/entities/{entityName}
+ ///
+ /// -
+ /// Operation Id
+ /// Entity_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of the entity. Must be unique within a health model.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response Exists(string entityName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(entityName, nameof(entityName));
+
+ using var scope = _entityClientDiagnostics.CreateScope("EntityCollection.Exists");
+ scope.Start();
+ try
+ {
+ var response = _entityRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, entityName, 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.CloudHealth/healthmodels/{healthModelName}/entities/{entityName}
+ ///
+ /// -
+ /// Operation Id
+ /// Entity_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of the entity. Must be unique within a health model.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> GetIfExistsAsync(string entityName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(entityName, nameof(entityName));
+
+ using var scope = _entityClientDiagnostics.CreateScope("EntityCollection.GetIfExists");
+ scope.Start();
+ try
+ {
+ var response = await _entityRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, entityName, cancellationToken: cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ return new NoValueResponse(response.GetRawResponse());
+ return Response.FromValue(new EntityResource(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.CloudHealth/healthmodels/{healthModelName}/entities/{entityName}
+ ///
+ /// -
+ /// Operation Id
+ /// Entity_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of the entity. Must be unique within a health model.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual NullableResponse GetIfExists(string entityName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(entityName, nameof(entityName));
+
+ using var scope = _entityClientDiagnostics.CreateScope("EntityCollection.GetIfExists");
+ scope.Start();
+ try
+ {
+ var response = _entityRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, entityName, cancellationToken: cancellationToken);
+ if (response.Value == null)
+ return new NoValueResponse(response.GetRawResponse());
+ return Response.FromValue(new EntityResource(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/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/EntityData.Serialization.cs b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/EntityData.Serialization.cs
new file mode 100644
index 000000000000..2c8cb650b692
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/EntityData.Serialization.cs
@@ -0,0 +1,155 @@
+// 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.CloudHealth.Models;
+using Azure.ResourceManager.Models;
+
+namespace Azure.ResourceManager.CloudHealth
+{
+ public partial class EntityData : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(EntityData)} does not support writing '{format}' format.");
+ }
+
+ base.JsonModelWriteCore(writer, options);
+ if (Optional.IsDefined(Properties))
+ {
+ writer.WritePropertyName("properties"u8);
+ writer.WriteObjectValue(Properties, options);
+ }
+ }
+
+ EntityData 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(EntityData)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeEntityData(document.RootElement, options);
+ }
+
+ internal static EntityData DeserializeEntityData(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ EntityProperties properties = default;
+ ResourceIdentifier id = default;
+ string name = default;
+ ResourceType type = default;
+ SystemData systemData = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("properties"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ properties = EntityProperties.DeserializeEntityProperties(property.Value, options);
+ 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 (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new EntityData(
+ id,
+ name,
+ type,
+ systemData,
+ properties,
+ 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(EntityData)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ EntityData 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, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeEntityData(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(EntityData)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+ }
+}
diff --git a/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/EntityData.cs b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/EntityData.cs
new file mode 100644
index 000000000000..dc328a4861fd
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/EntityData.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.CloudHealth.Models;
+using Azure.ResourceManager.Models;
+
+namespace Azure.ResourceManager.CloudHealth
+{
+ ///
+ /// A class representing the Entity data model.
+ /// An entity (aka node) of a health model
+ ///
+ public partial class EntityData : 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 EntityData()
+ {
+ }
+
+ /// Initializes a new instance of .
+ /// The id.
+ /// The name.
+ /// The resourceType.
+ /// The systemData.
+ /// The resource-specific properties for this resource.
+ /// Keeps track of any properties unknown to the library.
+ internal EntityData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, EntityProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData)
+ {
+ Properties = properties;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// The resource-specific properties for this resource.
+ public EntityProperties Properties { get; set; }
+ }
+}
diff --git a/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/EntityResource.Serialization.cs b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/EntityResource.Serialization.cs
new file mode 100644
index 000000000000..1da16070f480
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/EntityResource.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.CloudHealth
+{
+ public partial class EntityResource : IJsonModel
+ {
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options);
+
+ EntityData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options);
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options);
+
+ EntityData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options);
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options);
+ }
+}
diff --git a/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/EntityResource.cs b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/EntityResource.cs
new file mode 100644
index 000000000000..aa5f39b54e57
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/EntityResource.cs
@@ -0,0 +1,355 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Globalization;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.ResourceManager.CloudHealth
+{
+ ///
+ /// A Class representing an Entity along with the instance operations that can be performed on it.
+ /// If you have a you can construct an
+ /// from an instance of using the GetEntityResource method.
+ /// Otherwise you can get one from its parent resource using the GetEntity method.
+ ///
+ public partial class EntityResource : ArmResource
+ {
+ /// Generate the resource identifier of a instance.
+ /// The subscriptionId.
+ /// The resourceGroupName.
+ /// The healthModelName.
+ /// The entityName.
+ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string healthModelName, string entityName)
+ {
+ var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/entities/{entityName}";
+ return new ResourceIdentifier(resourceId);
+ }
+
+ private readonly ClientDiagnostics _entityClientDiagnostics;
+ private readonly EntitiesRestOperations _entityRestClient;
+ private readonly EntityData _data;
+
+ /// Gets the resource type for the operations.
+ public static readonly ResourceType ResourceType = "Microsoft.CloudHealth/healthmodels/entities";
+
+ /// Initializes a new instance of the class for mocking.
+ protected EntityResource()
+ {
+ }
+
+ /// Initializes a new instance of the class.
+ /// The client parameters to use in these operations.
+ /// The resource that is the target of operations.
+ internal EntityResource(ArmClient client, EntityData 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 EntityResource(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ _entityClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CloudHealth", ResourceType.Namespace, Diagnostics);
+ TryGetApiVersion(ResourceType, out string entityApiVersion);
+ _entityRestClient = new EntitiesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, entityApiVersion);
+#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 EntityData 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));
+ }
+
+ ///
+ /// Get a Entity
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/entities/{entityName}
+ ///
+ /// -
+ /// Operation Id
+ /// Entity_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual async Task> GetAsync(CancellationToken cancellationToken = default)
+ {
+ using var scope = _entityClientDiagnostics.CreateScope("EntityResource.Get");
+ scope.Start();
+ try
+ {
+ var response = await _entityRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new EntityResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a Entity
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/entities/{entityName}
+ ///
+ /// -
+ /// Operation Id
+ /// Entity_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ public virtual Response Get(CancellationToken cancellationToken = default)
+ {
+ using var scope = _entityClientDiagnostics.CreateScope("EntityResource.Get");
+ scope.Start();
+ try
+ {
+ var response = _entityRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new EntityResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Delete a Entity
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/entities/{entityName}
+ ///
+ /// -
+ /// Operation Id
+ /// Entity_Delete
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-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 = _entityClientDiagnostics.CreateScope("EntityResource.Delete");
+ scope.Start();
+ try
+ {
+ var response = await _entityRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);
+ var uri = _entityRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name);
+ var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString());
+ var operation = new CloudHealthArmOperation(response, rehydrationToken);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Delete a Entity
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/entities/{entityName}
+ ///
+ /// -
+ /// Operation Id
+ /// Entity_Delete
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-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 = _entityClientDiagnostics.CreateScope("EntityResource.Delete");
+ scope.Start();
+ try
+ {
+ var response = _entityRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken);
+ var uri = _entityRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name);
+ var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString());
+ var operation = new CloudHealthArmOperation(response, rehydrationToken);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletionResponse(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Create a Entity
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/entities/{entityName}
+ ///
+ /// -
+ /// Operation Id
+ /// Entity_CreateOrUpdate
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-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.
+ /// Resource create parameters.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual async Task> UpdateAsync(WaitUntil waitUntil, EntityData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _entityClientDiagnostics.CreateScope("EntityResource.Update");
+ scope.Start();
+ try
+ {
+ var response = await _entityRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false);
+ var uri = _entityRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data);
+ var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString());
+ var operation = new CloudHealthArmOperation(Response.FromValue(new EntityResource(Client, response), response.GetRawResponse()), rehydrationToken);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Create a Entity
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}/entities/{entityName}
+ ///
+ /// -
+ /// Operation Id
+ /// Entity_CreateOrUpdate
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-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.
+ /// Resource create parameters.
+ /// The cancellation token to use.
+ /// is null.
+ public virtual ArmOperation Update(WaitUntil waitUntil, EntityData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _entityClientDiagnostics.CreateScope("EntityResource.Update");
+ scope.Start();
+ try
+ {
+ var response = _entityRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken);
+ var uri = _entityRestClient.CreateCreateOrUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data);
+ var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString());
+ var operation = new CloudHealthArmOperation(Response.FromValue(new EntityResource(Client, response), response.GetRawResponse()), rehydrationToken);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletion(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+ }
+}
diff --git a/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/Extensions/CloudHealthExtensions.cs b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/Extensions/CloudHealthExtensions.cs
new file mode 100644
index 000000000000..391dbf8fc728
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/Extensions/CloudHealthExtensions.cs
@@ -0,0 +1,314 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure.Core;
+using Azure.ResourceManager.CloudHealth.Mocking;
+using Azure.ResourceManager.Resources;
+
+namespace Azure.ResourceManager.CloudHealth
+{
+ /// A class to add extension methods to Azure.ResourceManager.CloudHealth.
+ public static partial class CloudHealthExtensions
+ {
+ private static MockableCloudHealthArmClient GetMockableCloudHealthArmClient(ArmClient client)
+ {
+ return client.GetCachedClient(client0 => new MockableCloudHealthArmClient(client0));
+ }
+
+ private static MockableCloudHealthResourceGroupResource GetMockableCloudHealthResourceGroupResource(ArmResource resource)
+ {
+ return resource.GetCachedClient(client => new MockableCloudHealthResourceGroupResource(client, resource.Id));
+ }
+
+ private static MockableCloudHealthSubscriptionResource GetMockableCloudHealthSubscriptionResource(ArmResource resource)
+ {
+ return resource.GetCachedClient(client => new MockableCloudHealthSubscriptionResource(client, resource.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 HealthModelResource GetHealthModelResource(this ArmClient client, ResourceIdentifier id)
+ {
+ Argument.AssertNotNull(client, nameof(client));
+
+ return GetMockableCloudHealthArmClient(client).GetHealthModelResource(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 SignalDefinitionResource GetSignalDefinitionResource(this ArmClient client, ResourceIdentifier id)
+ {
+ Argument.AssertNotNull(client, nameof(client));
+
+ return GetMockableCloudHealthArmClient(client).GetSignalDefinitionResource(id);
+ }
+
+ ///
+ /// Gets an object representing an along with the instance operations that can be performed on it but with no data.
+ /// You can use to create an 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 AuthenticationSettingResource GetAuthenticationSettingResource(this ArmClient client, ResourceIdentifier id)
+ {
+ Argument.AssertNotNull(client, nameof(client));
+
+ return GetMockableCloudHealthArmClient(client).GetAuthenticationSettingResource(id);
+ }
+
+ ///
+ /// Gets an object representing an along with the instance operations that can be performed on it but with no data.
+ /// You can use to create an 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 EntityResource GetEntityResource(this ArmClient client, ResourceIdentifier id)
+ {
+ Argument.AssertNotNull(client, nameof(client));
+
+ return GetMockableCloudHealthArmClient(client).GetEntityResource(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 RelationshipResource GetRelationshipResource(this ArmClient client, ResourceIdentifier id)
+ {
+ Argument.AssertNotNull(client, nameof(client));
+
+ return GetMockableCloudHealthArmClient(client).GetRelationshipResource(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 DiscoveryRuleResource GetDiscoveryRuleResource(this ArmClient client, ResourceIdentifier id)
+ {
+ Argument.AssertNotNull(client, nameof(client));
+
+ return GetMockableCloudHealthArmClient(client).GetDiscoveryRuleResource(id);
+ }
+
+ ///
+ /// Gets a collection of HealthModelResources 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 HealthModelResources and their operations over a HealthModelResource.
+ public static HealthModelCollection GetHealthModels(this ResourceGroupResource resourceGroupResource)
+ {
+ Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource));
+
+ return GetMockableCloudHealthResourceGroupResource(resourceGroupResource).GetHealthModels();
+ }
+
+ ///
+ /// Get a HealthModel
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}
+ ///
+ /// -
+ /// Operation Id
+ /// HealthModel_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ /// -
+ /// Mocking
+ /// To mock this method, please mock instead.
+ ///
+ ///
+ /// The instance the method will execute against.
+ /// Name of health model resource.
+ /// The cancellation token to use.
+ /// or is null.
+ /// is an empty string, and was expected to be non-empty.
+ [ForwardsClientCalls]
+ public static async Task> GetHealthModelAsync(this ResourceGroupResource resourceGroupResource, string healthModelName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource));
+
+ return await GetMockableCloudHealthResourceGroupResource(resourceGroupResource).GetHealthModelAsync(healthModelName, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Get a HealthModel
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}
+ ///
+ /// -
+ /// Operation Id
+ /// HealthModel_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ /// -
+ /// Mocking
+ /// To mock this method, please mock instead.
+ ///
+ ///
+ /// The instance the method will execute against.
+ /// Name of health model resource.
+ /// The cancellation token to use.
+ /// or is null.
+ /// is an empty string, and was expected to be non-empty.
+ [ForwardsClientCalls]
+ public static Response GetHealthModel(this ResourceGroupResource resourceGroupResource, string healthModelName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource));
+
+ return GetMockableCloudHealthResourceGroupResource(resourceGroupResource).GetHealthModel(healthModelName, cancellationToken);
+ }
+
+ ///
+ /// List HealthModel resources by subscription ID
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/providers/Microsoft.CloudHealth/healthmodels
+ ///
+ /// -
+ /// Operation Id
+ /// HealthModel_ListBySubscription
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-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 GetHealthModelsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource));
+
+ return GetMockableCloudHealthSubscriptionResource(subscriptionResource).GetHealthModelsAsync(cancellationToken);
+ }
+
+ ///
+ /// List HealthModel resources by subscription ID
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/providers/Microsoft.CloudHealth/healthmodels
+ ///
+ /// -
+ /// Operation Id
+ /// HealthModel_ListBySubscription
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-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 GetHealthModels(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource));
+
+ return GetMockableCloudHealthSubscriptionResource(subscriptionResource).GetHealthModels(cancellationToken);
+ }
+ }
+}
diff --git a/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/Extensions/MockableCloudHealthArmClient.cs b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/Extensions/MockableCloudHealthArmClient.cs
new file mode 100644
index 000000000000..7b0b19e900ae
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/Extensions/MockableCloudHealthArmClient.cs
@@ -0,0 +1,109 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using Azure.Core;
+
+namespace Azure.ResourceManager.CloudHealth.Mocking
+{
+ /// A class to add extension methods to ArmClient.
+ public partial class MockableCloudHealthArmClient : ArmResource
+ {
+ /// Initializes a new instance of the class for mocking.
+ protected MockableCloudHealthArmClient()
+ {
+ }
+
+ /// 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 MockableCloudHealthArmClient(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ }
+
+ internal MockableCloudHealthArmClient(ArmClient client) : this(client, ResourceIdentifier.Root)
+ {
+ }
+
+ private string GetApiVersionOrNull(ResourceType resourceType)
+ {
+ TryGetApiVersion(resourceType, out string apiVersion);
+ return apiVersion;
+ }
+
+ ///
+ /// 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 HealthModelResource GetHealthModelResource(ResourceIdentifier id)
+ {
+ HealthModelResource.ValidateResourceId(id);
+ return new HealthModelResource(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 SignalDefinitionResource GetSignalDefinitionResource(ResourceIdentifier id)
+ {
+ SignalDefinitionResource.ValidateResourceId(id);
+ return new SignalDefinitionResource(Client, id);
+ }
+
+ ///
+ /// Gets an object representing an along with the instance operations that can be performed on it but with no data.
+ /// You can use to create an from its components.
+ ///
+ /// The resource ID of the resource to get.
+ /// Returns a object.
+ public virtual AuthenticationSettingResource GetAuthenticationSettingResource(ResourceIdentifier id)
+ {
+ AuthenticationSettingResource.ValidateResourceId(id);
+ return new AuthenticationSettingResource(Client, id);
+ }
+
+ ///
+ /// Gets an object representing an along with the instance operations that can be performed on it but with no data.
+ /// You can use to create an from its components.
+ ///
+ /// The resource ID of the resource to get.
+ /// Returns a object.
+ public virtual EntityResource GetEntityResource(ResourceIdentifier id)
+ {
+ EntityResource.ValidateResourceId(id);
+ return new EntityResource(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 RelationshipResource GetRelationshipResource(ResourceIdentifier id)
+ {
+ RelationshipResource.ValidateResourceId(id);
+ return new RelationshipResource(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 DiscoveryRuleResource GetDiscoveryRuleResource(ResourceIdentifier id)
+ {
+ DiscoveryRuleResource.ValidateResourceId(id);
+ return new DiscoveryRuleResource(Client, id);
+ }
+ }
+}
diff --git a/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/Extensions/MockableCloudHealthResourceGroupResource.cs b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/Extensions/MockableCloudHealthResourceGroupResource.cs
new file mode 100644
index 000000000000..a822a8d14baf
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/Extensions/MockableCloudHealthResourceGroupResource.cs
@@ -0,0 +1,105 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System;
+using System.Threading;
+using System.Threading.Tasks;
+using Azure.Core;
+
+namespace Azure.ResourceManager.CloudHealth.Mocking
+{
+ /// A class to add extension methods to ResourceGroupResource.
+ public partial class MockableCloudHealthResourceGroupResource : ArmResource
+ {
+ /// Initializes a new instance of the class for mocking.
+ protected MockableCloudHealthResourceGroupResource()
+ {
+ }
+
+ /// 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 MockableCloudHealthResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ }
+
+ private string GetApiVersionOrNull(ResourceType resourceType)
+ {
+ TryGetApiVersion(resourceType, out string apiVersion);
+ return apiVersion;
+ }
+
+ /// Gets a collection of HealthModelResources in the ResourceGroupResource.
+ /// An object representing collection of HealthModelResources and their operations over a HealthModelResource.
+ public virtual HealthModelCollection GetHealthModels()
+ {
+ return GetCachedClient(client => new HealthModelCollection(client, Id));
+ }
+
+ ///
+ /// Get a HealthModel
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}
+ ///
+ /// -
+ /// Operation Id
+ /// HealthModel_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of health model resource.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ [ForwardsClientCalls]
+ public virtual async Task> GetHealthModelAsync(string healthModelName, CancellationToken cancellationToken = default)
+ {
+ return await GetHealthModels().GetAsync(healthModelName, cancellationToken).ConfigureAwait(false);
+ }
+
+ ///
+ /// Get a HealthModel
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}
+ ///
+ /// -
+ /// Operation Id
+ /// HealthModel_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of health model resource.
+ /// The cancellation token to use.
+ /// is null.
+ /// is an empty string, and was expected to be non-empty.
+ [ForwardsClientCalls]
+ public virtual Response GetHealthModel(string healthModelName, CancellationToken cancellationToken = default)
+ {
+ return GetHealthModels().Get(healthModelName, cancellationToken);
+ }
+ }
+}
diff --git a/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/Extensions/MockableCloudHealthSubscriptionResource.cs b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/Extensions/MockableCloudHealthSubscriptionResource.cs
new file mode 100644
index 000000000000..f6efa4e53d25
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/Extensions/MockableCloudHealthSubscriptionResource.cs
@@ -0,0 +1,102 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+
+//
+
+#nullable disable
+
+using System.Threading;
+using Autorest.CSharp.Core;
+using Azure.Core;
+using Azure.Core.Pipeline;
+
+namespace Azure.ResourceManager.CloudHealth.Mocking
+{
+ /// A class to add extension methods to SubscriptionResource.
+ public partial class MockableCloudHealthSubscriptionResource : ArmResource
+ {
+ private ClientDiagnostics _healthModelClientDiagnostics;
+ private HealthModelsRestOperations _healthModelRestClient;
+
+ /// Initializes a new instance of the class for mocking.
+ protected MockableCloudHealthSubscriptionResource()
+ {
+ }
+
+ /// 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 MockableCloudHealthSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ }
+
+ private ClientDiagnostics HealthModelClientDiagnostics => _healthModelClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.CloudHealth", HealthModelResource.ResourceType.Namespace, Diagnostics);
+ private HealthModelsRestOperations HealthModelRestClient => _healthModelRestClient ??= new HealthModelsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(HealthModelResource.ResourceType));
+
+ private string GetApiVersionOrNull(ResourceType resourceType)
+ {
+ TryGetApiVersion(resourceType, out string apiVersion);
+ return apiVersion;
+ }
+
+ ///
+ /// List HealthModel resources by subscription ID
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/providers/Microsoft.CloudHealth/healthmodels
+ ///
+ /// -
+ /// Operation Id
+ /// HealthModel_ListBySubscription
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ /// An async collection of that may take multiple service requests to iterate over.
+ public virtual AsyncPageable GetHealthModelsAsync(CancellationToken cancellationToken = default)
+ {
+ HttpMessage FirstPageRequest(int? pageSizeHint) => HealthModelRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => HealthModelRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId);
+ return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HealthModelResource(Client, HealthModelData.DeserializeHealthModelData(e)), HealthModelClientDiagnostics, Pipeline, "MockableCloudHealthSubscriptionResource.GetHealthModels", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// List HealthModel resources by subscription ID
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/providers/Microsoft.CloudHealth/healthmodels
+ ///
+ /// -
+ /// Operation Id
+ /// HealthModel_ListBySubscription
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// The cancellation token to use.
+ /// A collection of that may take multiple service requests to iterate over.
+ public virtual Pageable GetHealthModels(CancellationToken cancellationToken = default)
+ {
+ HttpMessage FirstPageRequest(int? pageSizeHint) => HealthModelRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => HealthModelRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId);
+ return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HealthModelResource(Client, HealthModelData.DeserializeHealthModelData(e)), HealthModelClientDiagnostics, Pipeline, "MockableCloudHealthSubscriptionResource.GetHealthModels", "value", "nextLink", cancellationToken);
+ }
+ }
+}
diff --git a/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/HealthModelCollection.cs b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/HealthModelCollection.cs
new file mode 100644
index 000000000000..afebbbfaea7f
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/HealthModelCollection.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.CloudHealth
+{
+ ///
+ /// 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 GetHealthModels method from an instance of .
+ ///
+ public partial class HealthModelCollection : ArmCollection, IEnumerable, IAsyncEnumerable
+ {
+ private readonly ClientDiagnostics _healthModelClientDiagnostics;
+ private readonly HealthModelsRestOperations _healthModelRestClient;
+
+ /// Initializes a new instance of the class for mocking.
+ protected HealthModelCollection()
+ {
+ }
+
+ /// 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 HealthModelCollection(ArmClient client, ResourceIdentifier id) : base(client, id)
+ {
+ _healthModelClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CloudHealth", HealthModelResource.ResourceType.Namespace, Diagnostics);
+ TryGetApiVersion(HealthModelResource.ResourceType, out string healthModelApiVersion);
+ _healthModelRestClient = new HealthModelsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, healthModelApiVersion);
+#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));
+ }
+
+ ///
+ /// Create a HealthModel
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}
+ ///
+ /// -
+ /// Operation Id
+ /// HealthModel_Create
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-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.
+ /// Name of health model resource.
+ /// Resource create parameters.
+ /// 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 healthModelName, HealthModelData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(healthModelName, nameof(healthModelName));
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _healthModelClientDiagnostics.CreateScope("HealthModelCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var response = await _healthModelRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, healthModelName, data, cancellationToken).ConfigureAwait(false);
+ var operation = new CloudHealthArmOperation(new HealthModelOperationSource(Client), _healthModelClientDiagnostics, Pipeline, _healthModelRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, healthModelName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Create a HealthModel
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}
+ ///
+ /// -
+ /// Operation Id
+ /// HealthModel_Create
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-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.
+ /// Name of health model resource.
+ /// Resource create parameters.
+ /// 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 healthModelName, HealthModelData data, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(healthModelName, nameof(healthModelName));
+ Argument.AssertNotNull(data, nameof(data));
+
+ using var scope = _healthModelClientDiagnostics.CreateScope("HealthModelCollection.CreateOrUpdate");
+ scope.Start();
+ try
+ {
+ var response = _healthModelRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, healthModelName, data, cancellationToken);
+ var operation = new CloudHealthArmOperation(new HealthModelOperationSource(Client), _healthModelClientDiagnostics, Pipeline, _healthModelRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, healthModelName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation);
+ if (waitUntil == WaitUntil.Completed)
+ operation.WaitForCompletion(cancellationToken);
+ return operation;
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a HealthModel
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}
+ ///
+ /// -
+ /// Operation Id
+ /// HealthModel_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of health model resource.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> GetAsync(string healthModelName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(healthModelName, nameof(healthModelName));
+
+ using var scope = _healthModelClientDiagnostics.CreateScope("HealthModelCollection.Get");
+ scope.Start();
+ try
+ {
+ var response = await _healthModelRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, healthModelName, cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new HealthModelResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// Get a HealthModel
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}
+ ///
+ /// -
+ /// Operation Id
+ /// HealthModel_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of health model resource.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response Get(string healthModelName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(healthModelName, nameof(healthModelName));
+
+ using var scope = _healthModelClientDiagnostics.CreateScope("HealthModelCollection.Get");
+ scope.Start();
+ try
+ {
+ var response = _healthModelRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, healthModelName, cancellationToken);
+ if (response.Value == null)
+ throw new RequestFailedException(response.GetRawResponse());
+ return Response.FromValue(new HealthModelResource(Client, response.Value), response.GetRawResponse());
+ }
+ catch (Exception e)
+ {
+ scope.Failed(e);
+ throw;
+ }
+ }
+
+ ///
+ /// List HealthModel resources by resource group
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels
+ ///
+ /// -
+ /// Operation Id
+ /// HealthModel_ListByResourceGroup
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-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) => _healthModelRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _healthModelRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName);
+ return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new HealthModelResource(Client, HealthModelData.DeserializeHealthModelData(e)), _healthModelClientDiagnostics, Pipeline, "HealthModelCollection.GetAll", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// List HealthModel resources by resource group
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels
+ ///
+ /// -
+ /// Operation Id
+ /// HealthModel_ListByResourceGroup
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-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) => _healthModelRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName);
+ HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _healthModelRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName);
+ return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new HealthModelResource(Client, HealthModelData.DeserializeHealthModelData(e)), _healthModelClientDiagnostics, Pipeline, "HealthModelCollection.GetAll", "value", "nextLink", cancellationToken);
+ }
+
+ ///
+ /// Checks to see if the resource exists in azure.
+ ///
+ /// -
+ /// Request Path
+ /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CloudHealth/healthmodels/{healthModelName}
+ ///
+ /// -
+ /// Operation Id
+ /// HealthModel_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of health model resource.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> ExistsAsync(string healthModelName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(healthModelName, nameof(healthModelName));
+
+ using var scope = _healthModelClientDiagnostics.CreateScope("HealthModelCollection.Exists");
+ scope.Start();
+ try
+ {
+ var response = await _healthModelRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, healthModelName, 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.CloudHealth/healthmodels/{healthModelName}
+ ///
+ /// -
+ /// Operation Id
+ /// HealthModel_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of health model resource.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual Response Exists(string healthModelName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(healthModelName, nameof(healthModelName));
+
+ using var scope = _healthModelClientDiagnostics.CreateScope("HealthModelCollection.Exists");
+ scope.Start();
+ try
+ {
+ var response = _healthModelRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, healthModelName, 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.CloudHealth/healthmodels/{healthModelName}
+ ///
+ /// -
+ /// Operation Id
+ /// HealthModel_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of health model resource.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual async Task> GetIfExistsAsync(string healthModelName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(healthModelName, nameof(healthModelName));
+
+ using var scope = _healthModelClientDiagnostics.CreateScope("HealthModelCollection.GetIfExists");
+ scope.Start();
+ try
+ {
+ var response = await _healthModelRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, healthModelName, cancellationToken: cancellationToken).ConfigureAwait(false);
+ if (response.Value == null)
+ return new NoValueResponse(response.GetRawResponse());
+ return Response.FromValue(new HealthModelResource(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.CloudHealth/healthmodels/{healthModelName}
+ ///
+ /// -
+ /// Operation Id
+ /// HealthModel_Get
+ ///
+ /// -
+ /// Default Api Version
+ /// 2023-10-01-preview
+ ///
+ /// -
+ /// Resource
+ ///
+ ///
+ ///
+ ///
+ /// Name of health model resource.
+ /// The cancellation token to use.
+ /// is an empty string, and was expected to be non-empty.
+ /// is null.
+ public virtual NullableResponse GetIfExists(string healthModelName, CancellationToken cancellationToken = default)
+ {
+ Argument.AssertNotNullOrEmpty(healthModelName, nameof(healthModelName));
+
+ using var scope = _healthModelClientDiagnostics.CreateScope("HealthModelCollection.GetIfExists");
+ scope.Start();
+ try
+ {
+ var response = _healthModelRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, healthModelName, cancellationToken: cancellationToken);
+ if (response.Value == null)
+ return new NoValueResponse(response.GetRawResponse());
+ return Response.FromValue(new HealthModelResource(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/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/HealthModelData.Serialization.cs b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/HealthModelData.Serialization.cs
new file mode 100644
index 000000000000..fa4e2ef3f18b
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/HealthModelData.Serialization.cs
@@ -0,0 +1,196 @@
+// 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.CloudHealth.Models;
+using Azure.ResourceManager.Models;
+
+namespace Azure.ResourceManager.CloudHealth
+{
+ public partial class HealthModelData : IUtf8JsonSerializable, IJsonModel
+ {
+ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions);
+
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ writer.WriteStartObject();
+ JsonModelWriteCore(writer, options);
+ writer.WriteEndObject();
+ }
+
+ /// The JSON writer.
+ /// The client options for reading and writing models.
+ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options)
+ {
+ var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
+ if (format != "J")
+ {
+ throw new FormatException($"The model {nameof(HealthModelData)} does not support writing '{format}' format.");
+ }
+
+ base.JsonModelWriteCore(writer, options);
+ if (Optional.IsDefined(Properties))
+ {
+ writer.WritePropertyName("properties"u8);
+ writer.WriteObjectValue(Properties, options);
+ }
+ if (Optional.IsDefined(Identity))
+ {
+ writer.WritePropertyName("identity"u8);
+ var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } };
+ JsonSerializer.Serialize(writer, Identity, serializeOptions);
+ }
+ }
+
+ HealthModelData 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(HealthModelData)} does not support reading '{format}' format.");
+ }
+
+ using JsonDocument document = JsonDocument.ParseValue(ref reader);
+ return DeserializeHealthModelData(document.RootElement, options);
+ }
+
+ internal static HealthModelData DeserializeHealthModelData(JsonElement element, ModelReaderWriterOptions options = null)
+ {
+ options ??= ModelSerializationExtensions.WireOptions;
+
+ if (element.ValueKind == JsonValueKind.Null)
+ {
+ return null;
+ }
+ HealthModelProperties properties = default;
+ ManagedServiceIdentity identity = default;
+ IDictionary tags = default;
+ AzureLocation location = default;
+ ResourceIdentifier id = default;
+ string name = default;
+ ResourceType type = default;
+ SystemData systemData = default;
+ IDictionary serializedAdditionalRawData = default;
+ Dictionary rawDataDictionary = new Dictionary();
+ foreach (var property in element.EnumerateObject())
+ {
+ if (property.NameEquals("properties"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ properties = HealthModelProperties.DeserializeHealthModelProperties(property.Value, options);
+ continue;
+ }
+ if (property.NameEquals("identity"u8))
+ {
+ if (property.Value.ValueKind == JsonValueKind.Null)
+ {
+ continue;
+ }
+ var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } };
+ identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions);
+ continue;
+ }
+ 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 (options.Format != "W")
+ {
+ rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
+ }
+ }
+ serializedAdditionalRawData = rawDataDictionary;
+ return new HealthModelData(
+ id,
+ name,
+ type,
+ systemData,
+ tags ?? new ChangeTrackingDictionary(),
+ location,
+ properties,
+ identity,
+ 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(HealthModelData)} does not support writing '{options.Format}' format.");
+ }
+ }
+
+ HealthModelData 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, ModelSerializationExtensions.JsonDocumentOptions);
+ return DeserializeHealthModelData(document.RootElement, options);
+ }
+ default:
+ throw new FormatException($"The model {nameof(HealthModelData)} does not support reading '{options.Format}' format.");
+ }
+ }
+
+ string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
+ }
+}
diff --git a/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/HealthModelData.cs b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/HealthModelData.cs
new file mode 100644
index 000000000000..3032c1886d8d
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/HealthModelData.cs
@@ -0,0 +1,87 @@
+// 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.CloudHealth.Models;
+using Azure.ResourceManager.Models;
+
+namespace Azure.ResourceManager.CloudHealth
+{
+ ///
+ /// A class representing the HealthModel data model.
+ /// A HealthModel resource
+ ///
+ public partial class HealthModelData : 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 HealthModelData(AzureLocation location) : base(location)
+ {
+ }
+
+ /// Initializes a new instance of .
+ /// The id.
+ /// The name.
+ /// The resourceType.
+ /// The systemData.
+ /// The tags.
+ /// The location.
+ /// The resource-specific properties for this resource.
+ /// The managed service identities assigned to this resource.
+ /// Keeps track of any properties unknown to the library.
+ internal HealthModelData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, HealthModelProperties properties, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location)
+ {
+ Properties = properties;
+ Identity = identity;
+ _serializedAdditionalRawData = serializedAdditionalRawData;
+ }
+
+ /// Initializes a new instance of for deserialization.
+ internal HealthModelData()
+ {
+ }
+
+ /// The resource-specific properties for this resource.
+ public HealthModelProperties Properties { get; set; }
+ /// The managed service identities assigned to this resource.
+ public ManagedServiceIdentity Identity { get; set; }
+ }
+}
diff --git a/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/HealthModelResource.Serialization.cs b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/HealthModelResource.Serialization.cs
new file mode 100644
index 000000000000..c0f8ed4e2d67
--- /dev/null
+++ b/sdk/cloudhealth/Azure.ResourceManager.CloudHealth/src/Generated/HealthModelResource.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.CloudHealth
+{
+ public partial class HealthModelResource : IJsonModel
+ {
+ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options);
+
+ HealthModelData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options);
+
+ BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options);
+
+ HealthModelData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read